EntityLivingBase entity = (EntityLivingBase)event.entity;
Déjà la c’est pas bon, tu vas avoir un CastException si l’entité n’est pas une EntityLivingBase.
@ForgeSubscribe
public void onRespawn(EntityJoinWorldEvent event)
{
System.out.println("CemeteryZone");
System.out.println();
if(GuiDeath.mort == true)
{
if(entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)event.entity;
if(player .capabilities.isCreativeMode)
{
return;
}
else if(!player.capabilities.isCreativeMode)
{
BiomeGenBase location = event.entity.worldObj.getBiomeGenForCoords((int)event.entity.posX, (int)event.entity.posZ);
System.out.println("testrespawn");
System.out.println(GuiDeath.mort);
ChunkCoordinates biomeLocation = findClosestBlockOfBiome(player), BiomeGenBase.sky, 100);
player.setLocationAndAngles(biomeLocation.posX, 250, biomeLocation.posZ, player.rotationYaw, player.rotationPitch);
System.out.println("GuiDeath tp Cemetery");
}
}
}
}
}
C’est déjà plus propre comme ça.
Après tu as un NPE, donc a mon avis il n’a trouvé le biome voulu dans la fonction findClosestBlockOfBiome.