Interface EntitySpawnCallback.Pre
- Enclosing interface:
- EntitySpawnCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback for before the entity spawns. Use this to cancel, force succeed, or alter the entity spawning.
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.InteractionResultonEntitySpawnPre(net.minecraft.world.entity.Entity original, AtomicReference<net.minecraft.world.entity.Entity> entity, net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.entity.MobSpawnType reason)
-
Method Details
-
onEntitySpawnPre
net.minecraft.world.InteractionResult onEntitySpawnPre(net.minecraft.world.entity.Entity original, AtomicReference<net.minecraft.world.entity.Entity> entity, net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.entity.MobSpawnType reason) - Parameters:
original- the entity that was originally going to spawn.entity- the entity that is going to spawn. If this is different tooriginal, then a mod has modified the entity to spawn.world- the world in which the entity is to spawn.reason- the cause of the spawning.- Returns:
SUCCESSorCONSUMEto instantly succeed in spawning the entity in the world at its specified position.
PASSto leave SUCCESS/FAIL handling to subsequent events. If all events PASS, the action is determined to be a SUCCESS.
FAILcancel spawning the entity.
-