Interface EntityEvent.LivingCheckSpawn
- Enclosing interface:
- EntityEvent
public static interface EntityEvent.LivingCheckSpawn
-
Method Summary
Modifier and TypeMethodDescriptioncanSpawn(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 aBaseSpawneror during world generation. Equivalent to Forge'sLivingSpawnEvent.CheckSpawnevent.- 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 benull.- Returns:
- A
InteractionResultHolderdetermining the outcome of the event, if an outcome is set, the vanilla result is overridden.
-