d’acc alors se que j’ai fais a l’air de marcher par contre j’ai une erreur^^ a chaque fois que je meur.
Code:
@SubscribeEvent
public void PlayerDeathEvent2(LivingDeathEvent event){
if (event.entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) event.entity;
//ligne 65 player.inventory.getItemStack().equals(null);
}
}
Erreur:
[12:45:49] [Server thread/ERROR] [FML]: Index: 1 Listeners:
[12:45:49] [Server thread/ERROR] [FML]: 0: NORMAL
[12:45:49] [Server thread/ERROR] [FML]: 1: ASM: com.AltisMine.mod.EntityEvent@fd83ac PlayerDeathEvent2(Lnet/minecraftforge/event/entity/living/LivingDeathEvent;)V
[12:45:49] [Server thread/ERROR] [FML]: 2: ASM: com.AltisMine.mod.EntityEvent@fd83ac PlayerDeathEvent(Lnet/minecraftforge/event/entity/living/LivingDeathEvent;)V
[12:45:49] [Server thread/ERROR]: Couldn't process command: 'kill'
java.lang.NullPointerException
at com.AltisMine.mod.EntityEvent.PlayerDeathEvent2(EntityEvent.java:65) ~[EntityEvent.class:?]
at cpw.mods.fml.common.eventhandler.ASMEventHandler_13_EntityEvent_PlayerDeathEvent2_LivingDeathEvent.invoke(.dynamic) ~[?:?]
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?]
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) ~[EventBus.class:?]
at net.minecraftforge.common.ForgeHooks.onLivingDeath(ForgeHooks.java:305) ~[ForgeHooks.class:?]
at net.minecraft.entity.player.EntityPlayerMP.onDeath(EntityPlayerMP.java:443) ~[EntityPlayerMP.class:?]
at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:940) ~[EntityLivingBase.class:?]
at net.minecraft.entity.player.EntityPlayer.attackEntityFrom(EntityPlayer.java:1161) ~[EntityPlayer.class:?]
at net.minecraft.entity.player.EntityPlayerMP.attackEntityFrom(EntityPlayerMP.java:532) ~[EntityPlayerMP.class:?]
at net.minecraft.command.CommandKill.processCommand(CommandKill.java:32) ~[CommandKill.class:?]
at net.minecraft.command.CommandHandler.executeCommand(CommandHandler.java:96) [CommandHandler.class:?]
at net.minecraft.network.NetHandlerPlayServer.handleSlashCommand(NetHandlerPlayServer.java:788) [NetHandlerPlayServer.class:?]
at net.minecraft.network.NetHandlerPlayServer.processChatMessage(NetHandlerPlayServer.java:764) [NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.processPacket(C01PacketChatMessage.java:47) [C01PacketChatMessage.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.processPacket(C01PacketChatMessage.java:68) [C01PacketChatMessage.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [IntegratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
[12:45:49] [Client thread/INFO]: [CHAT] Cette commande a échoué suite à une erreur inconnue