public void onFallDamage(LivingHurtEvent event) {
if (!(event.getEntity() instanceof EntityPlayer)) return;
if (event.getSource() == EntityDamageSource.outOfWorld) {
EntityPlayer player = ((EntityPlayer) event.getEntityLiving());
BlockPos spawn = player.isSpawnForced(0) ? player.getBedLocation(0) : player.world.getSpawnPoint().add(player.world.rand.nextGaussian() * 16, 0, player.world.rand.nextGaussian() * 16);
<BUG>BlockPos teleportTo = spawn.add(0, 255 - spawn.getY(), 0);
</BUG>
TeleportUtil.teleportToDimension((EntityPlayer) event.getEntity(), 0, teleportTo.getX(), teleportTo.getY(), teleportTo.getZ());
event.getEntity().fallDistance = -500;
event.setCanceled(true);

public void onFallDamage(LivingHurtEvent event) {
if (!(event.getEntity() instanceof EntityPlayer)) return;
if (event.getSource() == EntityDamageSource.outOfWorld) {
EntityPlayer player = ((EntityPlayer) event.getEntityLiving());
BlockPos spawn = player.isSpawnForced(0) ? player.getBedLocation(0) : player.world.getSpawnPoint().add(player.world.rand.nextGaussian() * 16, 0, player.world.rand.nextGaussian() * 16);
BlockPos teleportTo = spawn.add(0, 300 - spawn.getY(), 0);
TeleportUtil.teleportToDimension((EntityPlayer) event.getEntity(), 0, teleportTo.getX(), teleportTo.getY(), teleportTo.getZ());
event.getEntity().fallDistance = -500;
event.setCanceled(true);
