use of net.minecraftforge.event.entity.EntityTravelToDimensionEvent in project MinecraftForge by MinecraftForge.
the class ForgeHooks method onTravelToDimension.
public static boolean onTravelToDimension(Entity entity, int dimension) {
EntityTravelToDimensionEvent event = new EntityTravelToDimensionEvent(entity, dimension);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled()) {
// Revert variable back to true as it would have been set to false
if (entity instanceof EntityMinecartContainer) {
((EntityMinecartContainer) entity).dropContentsWhenDead = true;
}
}
return !event.isCanceled();
}
Aggregations