Class LivingSpawnEvent.AllowDespawn

java.lang.Object
net.minecraftforge.eventbus.api.Event
Enclosing class:
LivingSpawnEvent

public static class LivingSpawnEvent.AllowDespawn extends LivingSpawnEvent
Fired each tick for despawnable mobs to allow control over despawning. Event.Result.DEFAULT will pass the mob on to vanilla despawn mechanics. Event.Result.ALLOW will force the mob to despawn. Event.Result.DENY will force the mob to remain. This is fired every tick for every despawnable entity. Be efficient in your handlers. Note: this is not fired if the mob is definitely going to otherwise despawn. It is fired to check if the mob can be allowed to despawn. See Entity.checkDespawn()
Author:
cpw
  • Constructor Details

    • AllowDespawn

      public AllowDespawn(Mob entity)