Temps de recharge dans un onRightClickEvent



  • Bonsoir!
    Est-ce que c'est possible de faire un temps de recharge (cooldown) pour évité le spam sur l'event onRightClickEvent sur un item?
    Si oui comment je peux procédé j'ai essayer de chercher pas trouvé , c'est possible avec l'event PlayerTickEvent ?
    Merci d'avance.


  • Moddeurs confirmés Rédacteurs Administrateurs

    Oui, il suffit juste d'utiliser les tag nbt + la fonction onUpdate.
    Il y a déjà au moins une demande d'aide qui traite ce sujet.



  • Tu serrais me les trouvés ou un mots clés stp ? se serrai super sympas.

    C'est bon j'ai trouvé 🙂

    https://www.minecraftforgefrance.fr/showthread.php?tid=2714&page=2&highlight=cooldown

    EDIT:

    Comment je peux faire pour la ? en gros je veux faire augmenté les dégats de l'épée de +10 (ou ajouter sharpness) mais que pour un seul coup (ou une seconde) et pas pour tout le temps

    
        public boolean hitEntity(ItemStack stack, EntityLivingBase base1, EntityLivingBase base2)
        {
        if(!stack.hasTagCompound())//Même condition, si ton item n'a pas de tag on lui en ajoute avec l'int timer en +
        {
        stack.setTagCompound(new NBTTagCompound());
        stack.stackTagCompound.setInteger("timer", 0);
        }
        if(stack.stackTagCompound.getInteger("timer") == 0){
        stack.stackTagCompound.setInteger("timer", 1);
        stack.setItemDamage(10);
    
        }
            return true;
        }
    
    

  • Moddeurs confirmés Rédacteurs Administrateurs

    stack.setItemDamage(10) ça défini le metadata.
    Si tu veux faire plus de dégât il faut plutôt utiliser base2.attackFrom(source de dégât);



  • public boolean hitEntity(ItemStack stack, EntityLivingBase base1,
    EntityLivingBase base2){
    
    base2.attackEntityFrom(DamageSource.inFire, 10);
    return true;
    }
    
    return true;
    }
    

    J'ai fais ça rien ne se passe normal? je met toujours 4 coup pour tuer le pigman



  • Déjà y'a un problème parce que t'as 2 return à la suite



  • Ensuite il faudra que t'override la méthode onUpdate pour incrémenter ton timer, ou décrémenter selon ton organisation. Tu nous enverras aussi cette méthode pour qu'on s'assure qu'il n'y ait aucune erreur



  • Pour le double return c'est un soucis de ctrl v

    KDO:

    
    @Override
    public void onUpdate(ItemStack item, World world, Entity player,
    int slotIndex, boolean inHand) {
    if (item.hasTagCompound())// Si ton item n'a pas de tag alors on ne fait
    // rien
    {
    if (item.stackTagCompound.getInteger("timer") > 0)// si ton timer
    // est supérieur
    // à 0 (après un
    // clic droit
    // logiquement)
    {
    item.stackTagCompound.setInteger("timer",
    (int) (item.stackTagCompound.getInteger("timer") + 1));// On
    // l'incrémente
    // de
    // 1
    // à
    // chaque
    // tick
    }
    if (item.stackTagCompound.getInteger("timer") >= (int) (45 * 20))// Remplace
    // 6
    // par
    // le
    // nombre
    // de
    // secondes
    // du
    // timer
    // souhaité
    {
    item.stackTagCompound.setInteger("timer", 0);// On remet à 0 si
    // le timer est
    // arrivé à la
    // limite
    // souhaitée
    }
    }
    super.onUpdate(item, world, player, slotIndex, inHand);
    }
    


  • Maintenant tu dois accéder à cette valeur lorsque tu frappes avec ton item (il y a une fonction pour ça)



  • @'SCAREX':

    Maintenant tu dois accéder à cette valeur lorsque tu frappes avec ton item (il y a une fonction pour ça)

    La fonction c'est hitentity non?



  • Tout dépend de ce que tu veux faire, si c'est infliger des dégâts de feu oui



  • @'SCAREX':

    Tout dépend de ce que tu veux faire, si c'est infliger des dégâts de feu oui

    Oui voila je veux augmenter les dégats de un seul coup d'épée de 10 quand mon timer et a 0

    public boolean hitEntity(ItemStack stack, EntityLivingBase base1,
    EntityLivingBase base2){
    if (!stack.hasTagCompound())// Même condition, si ton item n'a pas de tag
    // on lui en ajoute avec l'int timer en +
    {
    stack.setTagCompound(new NBTTagCompound());
    stack.stackTagCompound.setInteger("timer", 0);
    }
    if (stack.stackTagCompound.getInteger("timer") == 0){
    
    base2.attackEntityFrom(DamageSource.inFire, 10);
    stack.stackTagCompound.setInteger("timer", 1);
    }
    return true;
    }
    


    • [font=monospaceif] font=monospace
      Inutile puisque la fonction onupdate sera fired dès le premier tick, donc bien avant que tu n'aies le temps de frapper une entity avec. Ce qui veut dire, que ton itemstack aura depuis bien longtemps associer des tags. Tu peux donc virer toute la condition et ce qui en résultat (setTagCompound() et setInteger())
    • Et pour ta fonction onUpdate, peux-tu nous la renvoyer avec du code bien formaté et propre, et sans les commentaires, on n'en a pas besoin …
    • Et dernière chose, indiquer que le damagesource de la méthode attackEntityFrom est celui du feu, ne veut pas dire que ton entity sera en feu, hein ?! Si tu souhaites lui faire des dégâts liés à un damagesource fire (10 demie-cœurs de dégâts, à ce que je vois), mais que tu veux aussi mettre l'entity en feu, rajoute un setFire(durée en ticks)


  • D'accord ^^ j'avais pas compris ok
    tien pour le onupdate:

    
    @Override
    public void onUpdate(ItemStack item, World world, Entity player,
    int slotIndex, boolean inHand) {
    if (item.hasTagCompound())
    {
    if (item.stackTagCompound.getInteger("timer") > 0)
    {
    item.stackTagCompound.setInteger("timer",
    (int) (item.stackTagCompound.getInteger("timer") + 1));
    }
    if (item.stackTagCompound.getInteger("timer") >= (int) (45 * 20))
    {
    item.stackTagCompound.setInteger("timer", 0);
    }
    }
    super.onUpdate(item, world, player, slotIndex, inHand);
    }
    
    

    edit:

    meme après avoir fait se que tu m'as dis je met toujours autant de coup pour tuer le pigman et il n'est pas en feu:

    
    public boolean hitEntity(ItemStack stack, EntityLivingBase base1,
    EntityLivingBase base2){
    
    if (stack.stackTagCompound.getInteger("timer") == 0){
    
    base2.attackEntityFrom(DamageSource.inFire, 10);
    base2.setFire(20);
    }
    return true;
    }
    


  • Pas testé mais ça devrait marcher, je pense :

    
    public class ItemTestSword extends ItemSword
    {
    
    public ItemTestSword()
    {
    super(ToolMaterial.EMERALD);
    }
    
    public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isInhand)
    {
    super.onUpdate(stack, world, entity, slotIndex, isInhand);
    if(!stack.hasTagCompound())
    stack.setTagCompound(new NBTTagCompound());
    
    int timer = !stack.getTagCompound().hasKey("timer") ? 0 : stack.getTagCompound().getInteger("timer");
    timer++;
    stack.getTagCompound().setInteger("timer", timer);
    
    System.out.println(stack.getTagCompound().getInteger("timer"));
    }
    
    public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
    {
    if(stack.getTagCompound().getInteger("timer") >= 2 * 20)
    {
    target.setFire(1 * 20);
    target.attackEntityFrom(DamageSource.inFire, 5 * 2);
    stack.getTagCompound().setInteger("timer", 0);
    }
    return true;
    }
    }
    
    

  • Moddeurs confirmés Rédacteurs Administrateurs

    print la valeur de stack.stackTagCompound.getInteger("timer")
    Et actuellement ton tag n'est plus jamais créé s'il n'existe pas.



  • Non bizarre rien



  • Ah j'ai pas fait attention mais remplace le 2*20 par le nombre de ticks que tu souhaitais, et normal que tu ne vois pas le feu sur les pigmans, ils sont immunisés –'
    Print (comme l'a si bien dit robin), la valeur timer enregistrée dans les tags



  • Ah c'est bon!

    Par contre crash !

    
    [18:34:58] [main/INFO] [GradleStart]: username: floriangabet
    [18:34:58] [main/INFO] [GradleStart]: Extra: []
    [18:34:58] [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, --username, floriangabet, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
    [18:34:58] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
    [18:34:58] [main/INFO] [FML]: Forge Mod Loader version 7.10.85.1291 for Minecraft 1.7.10 loading
    [18:34:58] [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
    [18:34:58] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    [18:34:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
    [18:34:58] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
    [18:34:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
    [18:34:58] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
    [18:34:58] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [18:34:58] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
    [18:34:59] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
    [18:34:59] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
    [18:34:59] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
    [18:34:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
    [18:34:59] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
    [18:34:59] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
    [18:34:59] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
    [18:34:59] [main/INFO]: Setting user: floriangabet
    [18:35:00] [Client thread/INFO]: LWJGL Version: 2.9.1
    [18:35:00] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
    [18:35:00] [Client thread/INFO] [FML]: MinecraftForge v10.13.2.1291 Initialized
    [18:35:00] [Client thread/INFO] [FML]: Replaced 183 ore recipies
    [18:35:00] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
    [18:35:00] [Client thread/INFO] [FML]: Searching C:\Users\Admin\Documents\Modding\LegacyMod\eclipse\mods for mods
    [18:35:00] [Client thread/INFO] [lc]: Mod lc is missing the required element 'name'. Substituting lc
    [18:35:02] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
    [18:35:02] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, lc] at CLIENT
    [18:35:02] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, lc] at SERVER
    [18:35:02] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:lc, [1.10] Firewolf v1.36.zip
    [18:35:02] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
    [18:35:02] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
    [18:35:02] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
    [18:35:02] [Client thread/INFO] [FML]: Applying holder lookups
    [18:35:02] [Client thread/INFO] [FML]: Holder lookups applied
    [18:35:02] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [18:35:02] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [18:35:02] [Thread-5/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [18:35:02] [Thread-5/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [18:35:02] [Thread-5/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [18:35:03] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [18:35:03] [Sound Library Loader/INFO]: Sound engine started
    [18:35:05] [Client thread/INFO]: Created: 2048x2048 textures/blocks-atlas
    [18:35:05] [Client thread/INFO]: Created: 256x256 textures/items-atlas
    [18:35:05] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
    [18:35:05] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:lc, [1.10] Firewolf v1.36.zip
    [18:35:07] [Client thread/INFO]: Created: 2048x2048 textures/blocks-atlas
    [18:35:07] [Client thread/INFO]: Created: 256x256 textures/items-atlas
    [18:35:07] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [18:35:07] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
    [18:35:08] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:     Author: Paul Lamb, www.paulscode.com
    [18:35:08] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [18:35:08] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [18:35:08] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
    [18:35:08] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
    [18:35:08] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
    [18:35:08] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
    [18:35:08] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
    [18:35:08] [Sound Library Loader/INFO]: Sound engine started
    [18:35:10] [Server thread/INFO]: Starting integrated minecraft server version 1.7.10
    [18:35:10] [Server thread/INFO]: Generating keypair
    [18:35:10] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
    [18:35:10] [Server thread/INFO] [FML]: Injecting new block and item data into this server instance.
    [18:35:10] [Server thread/INFO] [FML]: Injected new block/item lc:test: 4098 (init) -> 4098 (map).
    [18:35:10] [Server thread/INFO] [FML]: Applying holder lookups
    [18:35:10] [Server thread/INFO] [FML]: Holder lookups applied
    [18:35:11] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@115f9ec)
    [18:35:11] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@115f9ec)
    [18:35:11] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@115f9ec)
    [18:35:11] [Server thread/INFO]: Preparing start region for level 0
    [18:35:11] [Server thread/INFO]: Changing view distance to 8, from 10
    [18:35:12] [Netty Client IO #0/INFO] [FML]: Server protocol version 1
    [18:35:12] [Netty IO #1/INFO] [FML]: Client protocol version 1
    [18:35:12] [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
    [18:35:12] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
    [18:35:12] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER
    [18:35:12] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established
    [18:35:12] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
    [18:35:12] [Server thread/INFO]: floriangabet[local:E:cfdfeea9] logged in with entity id 353 at (-136.6903569380041, 76.0, 272.62722809298504)
    [18:35:12] [Server thread/INFO]: floriangabet joined the game
    [18:35:27] [Server thread/ERROR]: Encountered an unexpected exception
    net.minecraft.util.ReportedException: Ticking memory connection
    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.NullPointerException
    at net.legacymod.items.test.hitEntity(test.java:33) ~[test.class:?]
    at net.minecraft.item.ItemStack.hitEntity(ItemStack.java:371) ~[ItemStack.class:?]
    at net.minecraft.entity.player.EntityPlayer.attackTargetEntityWithCurrentItem(EntityPlayer.java:1436) ~[EntityPlayer.class:?]
    at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:881) ~[NetHandlerPlayServer.class:?]
    at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51) ~[C02PacketUseEntity.class:?]
    at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69) ~[C02PacketUseEntity.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
    [18:35:27] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Admin\Documents\Modding\LegacyMod\eclipse\.\crash-reports\crash-2016-07-05_18.35.27-server.txt
    [18:35:27] [Server thread/INFO]: Stopping server
    [18:35:27] [Server thread/INFO]: Saving players
    [18:35:27] [Server thread/INFO]: Saving worlds
    [18:35:27] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
    [18:35:27] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
    // Quite honestly, I wouldn't worry myself about that.
    
    Time: 05/07/16 18:35
    Description: Ticking memory connection
    
    java.lang.NullPointerException: Ticking memory connection
    at net.legacymod.items.test.hitEntity(test.java:33)
    at net.minecraft.item.ItemStack.hitEntity(ItemStack.java:371)
    at net.minecraft.entity.player.EntityPlayer.attackTargetEntityWithCurrentItem(EntityPlayer.java:1436)
    at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:881)
    at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51)
    at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69)
    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 net.legacymod.items.test.hitEntity(test.java:33)
    at net.minecraft.item.ItemStack.hitEntity(ItemStack.java:371)
    at net.minecraft.entity.player.EntityPlayer.attackTargetEntityWithCurrentItem(EntityPlayer.java:1436)
    at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:881)
    at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51)
    at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
    
    -- Ticking connection --
    Details:
    Connection: net.minecraft.network.NetworkManager@b84446
    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: 812637320 bytes (774 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['floriangabet'/353, l='New World', x=-128,64, y=76,00, z=268,90]]
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    [18:35:27] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-07-05_18.35.27-server.txt
    [18:35:27] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
    [18:35:27] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
    [18:35:27] [Server thread/INFO]: Saving chunks for level 'New World'/The End
    [18:35:27] [Server thread/INFO] [FML]: Unloading dimension 0
    [18:35:27] [Server thread/INFO] [FML]: Unloading dimension -1
    [18:35:27] [Server thread/INFO] [FML]: Unloading dimension 1
    [18:35:27] [Server thread/INFO] [FML]: Applying holder lookups
    [18:35:27] [Server thread/INFO] [FML]: Holder lookups applied
    [18:35:27] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
    [18:35:27] [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
    
    

    Ligne 33 de test correspond à:

    
    public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
       {
        if(stack.getTagCompound().getInteger("timer2") >= 2 * 20) // ici
        {
        target.setFire(20 * 20);
        target.attackEntityFrom(DamageSource.inFire, 5 * 2);
        stack.getTagCompound().setInteger("timer2", 0);
        }
           return true;
       }
    
    


  • Pourquoi t'as renommé l'id par timer2 ? T'as sûrement dû laisser timer dans onUpdate()


Log in to reply