Interface EntityEvent.LivingCheckSpawn

Enclosing interface:
EntityEvent

public static interface EntityEvent.LivingCheckSpawn
  • Method Summary

    Modifier and Type
    Method
    Description
    canSpawn(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.level.LevelAccessor world, double x, double y, double z, net.minecraft.world.entity.MobSpawnType type, @Nullable net.minecraft.world.level.BaseSpawner spawner)
    Invoked before an entity is spawned into the world.
  • Method Details

    • canSpawn

      EventResult canSpawn(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.level.LevelAccessor world, double x, double y, double z, net.minecraft.world.entity.MobSpawnType type, @Nullable @Nullable net.minecraft.world.level.BaseSpawner spawner)
      Invoked before an entity is spawned into the world. This specifically concerns spawning through either a BaseSpawner or during world generation. Equivalent to Forge's LivingSpawnEvent.CheckSpawn event.
      Parameters:
      entity - The entity that is about to spawn.
      world - The level the entity wants to spawn in.
      x - The x-coordinate of the spawn position.
      y - The y-coordinate of the spawn position.
      z - The z-coordinate the spawn position.
      type - The source of spawning.
      spawner - The spawner. Can be null.
      Returns:
      A InteractionResultHolder determining the outcome of the event, if an outcome is set, the vanilla result is overridden.