Comment cancelled un item est sur le point d'être ramassé par un joueur



  • Bonsoir!
    J'aimerai cancelled l'event PlayerEvent.ItemPickupEvent mais problème quand je le cancelled mon jeu crash.
    Merci d'avance!



  • Crash-report ?



  • [20:15:28] [main/INFO] [GradleStart]: Extra: []
    [20:15:29] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Admin/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
    [20:15:29] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
    [20:15:29] [main/INFO] [FML]: Forge Mod Loader version 7.10.85.1291 for Minecraft 1.7.10 loading
    [20:15:29] [main/INFO] [FML]: Java is Java HotSpot(TM) Client VM, version 1.8.0_45, running on Windows 7:x86:6.1, installed at C:\Program Files (x86)\Java\jdk1.8.0_45\jre
    [20:15:29] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
    [20:15:29] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
    [20:15:29] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
    [20:15:29] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [20:15:29] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
    [20:15:29] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
    [20:15:29] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
    [20:15:30] [main/INFO]: Setting user: Player836
    [20:15:30] [Client thread/INFO]: LWJGL Version: 2.9.1
    [20:15:31] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
    [20:15:31] [Client thread/INFO] [FML]: MinecraftForge v10.13.2.1291 Initialized
    [20:15:31] [Client thread/INFO] [FML]: Replaced 183 ore recipies
    [20:15:31] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
    [20:15:31] [Client thread/INFO] [FML]: Searching C:\Users\Admin\Documents\Modding\LegacyMod\eclipse\mods for mods
    [20:15:31] [Client thread/INFO] [lc]: Mod lc is missing the required element 'name'. Substituting lc
    [20:15:32] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
    [20:15:32] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, lc] at CLIENT
    [20:15:32] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, lc] at SERVER
    [20:15:32] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:lc, [1.10] Firewolf v1.36.zip
    [20:15:32] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
    [20:15:32] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
    [20:15:32] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
    [20:15:32] [Client thread/INFO] [FML]: Applying holder lookups
    [20:15:32] [Client thread/INFO] [FML]: Holder lookups applied
    [20:15:32] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [20:15:32] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [20:15:33] [Thread-5/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [20:15:33] [Thread-5/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [20:15:33] [Thread-5/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [20:15:33] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [20:15:33] [Sound Library Loader/INFO]: Sound engine started
    [20:15:35] [Client thread/INFO]: Created: 2048x2048 textures/blocks-atlas
    [20:15:35] [Client thread/INFO]: Created: 256x256 textures/items-atlas
    [20:15:35] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
    [20:15:35] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:lc, [1.10] Firewolf v1.36.zip
    [20:15:37] [Client thread/INFO]: Created: 2048x2048 textures/blocks-atlas
    [20:15:37] [Client thread/INFO]: Created: 256x256 textures/items-atlas
    [20:15:37] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [20:15:37] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
    [20:15:38] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:     Author: Paul Lamb, www.paulscode.com
    [20:15:38] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [20:15:38] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [20:15:38] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [20:15:38] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [20:15:38] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [20:15:38] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [20:15:38] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [20:15:38] [Sound Library Loader/INFO]: Sound engine started
    [20:15:40] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10
    [20:15:40] [Server thread/INFO]: Generating keypair
    [20:15:40] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
    [20:15:40] [Server thread/INFO] [FML]: Applying holder lookups
    [20:15:40] [Server thread/INFO] [FML]: Holder lookups applied
    [20:15:40] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@b020b7)
    [20:15:40] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@b020b7)
    [20:15:40] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@b020b7)
    [20:15:40] [Server thread/INFO]: Preparing start region for level 0
    [20:15:40] [Server thread/INFO]: Changing view distance to 8, from 10
    [20:15:41] [Netty Client IO #0/INFO] [FML]: Server protocol version 1
    [20:15:41] [Netty IO #1/INFO] [FML]: Client protocol version 1
    [20:15:41] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : FML@7.10.85.1291,lc@1.0,Forge@10.13.2.1291,mcp@9.05
    [20:15:41] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
    [20:15:41] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER
    [20:15:41] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
    [20:15:41] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established
    [20:15:41] [Server thread/INFO]: Player836[local:E:743b22d3] logged in with entity id 354 at (-147.98337485239264, 74.0, 223.58265662048873)
    [20:15:41] [Server thread/INFO]: Player836 joined the game
    [20:15:45] [Server thread/INFO] [STDOUT]: [net.legacymod.events.Events:onLoot:17]: 
    [20:15:45] [Server thread/ERROR] [FML]: Exception caught during firing event cpw.mods.fml.common.gameevent.PlayerEvent$ItemPickupEvent@16f02ff:
    java.lang.IllegalArgumentException: Attempted to cancel a uncancelable event
    at cpw.mods.fml.common.eventhandler.Event.setCanceled(Event.java:111) ~[Event.class:?]
    at net.legacymod.events.Events.onLoot(Events.java:18) ~[Events.class:?]
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_7_Events_onLoot_ItemPickupEvent.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 cpw.mods.fml.common.FMLCommonHandler.firePlayerItemPickupEvent(FMLCommonHandler.java:565) [FMLCommonHandler.class:?]
    at net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityItem.java:430) [EntityItem.class:?]
    at net.minecraft.entity.player.EntityPlayer.collideWithPlayer(EntityPlayer.java:681) [EntityPlayer.class:?]
    at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:672) [EntityPlayer.class:?]
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1816) [EntityLivingBase.class:?]
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:327) [EntityPlayer.class:?]
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:330) [EntityPlayerMP.class:?]
    at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:329) [NetHandlerPlayServer.class:?]
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:37) [C03PacketPlayer.class:?]
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:111) [C03PacketPlayer.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:?]
    [20:15:45] [Server thread/ERROR] [FML]: Index: 1 Listeners:
    [20:15:45] [Server thread/ERROR] [FML]: 0: NORMAL
    [20:15:45] [Server thread/ERROR] [FML]: 1: ASM: net.legacymod.events.Events@147b761 onLoot(Lcpw/mods/fml/common/gameevent/PlayerEvent$ItemPickupEvent;)V
    [20:15:45] [Server thread/ERROR]: Encountered an unexpected exception
    net.minecraft.util.ReportedException: Ticking player
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[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:?]
    Caused by: java.lang.IllegalArgumentException: Attempted to cancel a uncancelable event
    at cpw.mods.fml.common.eventhandler.Event.setCanceled(Event.java:111) ~[Event.class:?]
    at net.legacymod.events.Events.onLoot(Events.java:18) ~[Events.class:?]
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_7_Events_onLoot_ItemPickupEvent.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 cpw.mods.fml.common.FMLCommonHandler.firePlayerItemPickupEvent(FMLCommonHandler.java:565) ~[FMLCommonHandler.class:?]
    at net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityItem.java:430) ~[EntityItem.class:?]
    at net.minecraft.entity.player.EntityPlayer.collideWithPlayer(EntityPlayer.java:681) ~[EntityPlayer.class:?]
    at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:672) ~[EntityPlayer.class:?]
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1816) ~[EntityLivingBase.class:?]
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:327) ~[EntityPlayer.class:?]
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:330) ~[EntityPlayerMP.class:?]
    at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:329) ~[NetHandlerPlayServer.class:?]
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:37) ~[C03PacketPlayer.class:?]
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:111) ~[C03PacketPlayer.class:?]
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]
    … 5 more
    [20:15:45] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Admin\Documents\Modding\LegacyMod\eclipse\.\crash-reports\crash-2016-07-01_20.15.45-server.txt
    [20:15:45] [Server thread/INFO]: Stopping server
    [20:15:45] [Server thread/INFO]: Saving players
    [20:15:45] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
    // Uh... Did I do that?
    
    Time: 01/07/16 20:15
    Description: Ticking player
    
    java.lang.IllegalArgumentException: Attempted to cancel a uncancelable event
    at cpw.mods.fml.common.eventhandler.Event.setCanceled(Event.java:111)
    at net.legacymod.events.Events.onLoot(Events.java:18)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_7_Events_onLoot_ItemPickupEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
    at cpw.mods.fml.common.FMLCommonHandler.firePlayerItemPickupEvent(FMLCommonHandler.java:565)
    at net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityItem.java:430)
    at net.minecraft.entity.player.EntityPlayer.collideWithPlayer(EntityPlayer.java:681)
    at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:672)
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1816)
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:327)
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:330)
    at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:329)
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:37)
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:111)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    at cpw.mods.fml.common.eventhandler.Event.setCanceled(Event.java:111)
    at net.legacymod.events.Events.onLoot(Events.java:18)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_7_Events_onLoot_ItemPickupEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
    at cpw.mods.fml.common.FMLCommonHandler.firePlayerItemPickupEvent(FMLCommonHandler.java:565)
    at net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityItem.java:430)
    at net.minecraft.entity.player.EntityPlayer.collideWithPlayer(EntityPlayer.java:681)
    at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:672)
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1816)
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:327)
    
    -- Player being ticked --
    Details:
    Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
    Entity ID: 354
    Entity Name: Player836
    Entity's Exact location: -146,15, 74,00, 225,03
    Entity's Block location: World: (-147,74,225), Chunk: (at 13,4,1 in -10,14; contains blocks -160,0,224 to -145,255,239), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    Entity's Momentum: 0,00, -0,08, 0,00
    Stacktrace:
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:330)
    at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:329)
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:37)
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:111)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
    
    -- Ticking connection --
    Details:
    Connection: net.minecraft.network.NetworkManager@13be8df
    Stacktrace:
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
    
    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.8.0_45, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 745111696 bytes (710 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
    FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 4 mods loaded, 4 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    lc{1.0} [lc] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Player Count: 1 / 8; [EntityPlayerMP['Player836'/354, l='New World', x=-146,15, y=74,00, z=225,03]]
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    [20:15:45] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-07-01_20.15.45-server.txt
    [20:15:45] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
    [20:15:45] [Server thread/INFO]: Saving worlds
    [20:15:45] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
    [20:15:45] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
    [20:15:45] [Server thread/INFO]: Saving chunks for level 'New World'/The End
    [20:15:45] [Server thread/INFO] [FML]: Unloading dimension 0
    [20:15:45] [Server thread/INFO] [FML]: Unloading dimension -1
    [20:15:45] [Server thread/INFO] [FML]: Unloading dimension 1
    [20:15:45] [Server thread/INFO] [FML]: Applying holder lookups
    [20:15:45] [Server thread/INFO] [FML]: Holder lookups applied
    [20:15:45] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
    [20:15:45] [Client thread/INFO] [FML]: Server terminated.
    AL lib: (EE) alc_cleanup: 1 device not closed
    Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
    
    

    Event:

    
    @SubscribeEvent
    public void onLoot(PlayerEvent.ItemPickupEvent event){
    EntityPlayer player = event.player;
    EntityItem pick = event.pickedUp;
    
    if(player.inventory.hasItem(Items.iron_sword)){
    System.out.println("");
    event.setCanceled(true);
    
    }
    }
    


  • Utilise plutôt l'event EntityItemPickupEvent 😉



  • "java.lang.IllegalArgumentException: Attempted to cancel a uncancelable event" On ne peut pas cancel cet event.



  • Ah ouais! super merci 🙂 et quand je fais sa ça marche pas:

    
    @SubscribeEvent
    public void onLoot(EntityItemPickupEvent  event){
    EntityPlayer player = event.entityPlayer;
    EntityItem pick = event.item;
    
    if(player.inventory.hasItem(Items.iron_sword) && pick.getEntityId() == 1){
    event.setCanceled(true);
    
    }
    }
    


  • Pourquoi avoir rajouté ça : && pick.getEntityId() == 1 ?

    EDIT = Peut-être aussi que l'event se déclenche avant d'ajouter l'itemstack dans l'inventaire, donc peut-être aussi que ta condition hasItem ne renverra jamais true.



  • Bah en gros se que je veux faire c'est genre une fois lépée dans l'inventaire il ne peut pas ramasser de bloc de stone mais tout les autre item / bloc oui



  • Comme ça je dirai :

    
    @SubscribeEvent
    public void onPickupItem(EntityItemPickupEvent event)
    {
    if(event.entityPlayer.inventory.hasItem(Items.stone_sword) && event.item.getEntityItem().getItem() == Item.getItemFromBlock(Blocks.stone))
    event.setCanceled(true);
    }
    
    


  • Ouaip thx 🙂


Log in to reply