Navigation

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SOLVED Petit problème avec ma Dynamite

    1.7.x
    1.7.10
    2
    3
    237
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      LuvasTV last edited by LuvasTV

      Bonjour j’ai fais une dynamite, tout marche bien et au début je l’avais mis en stacksize 1 et donc là je viens de la mettre à 16 et la fonction que j’utilisais ne peut plus marcher, j’ai mis “-stack.stackSize” et ça ne marche pas, il y a une errreur…

      Le code de l’item :

      package fr.luvastv.deltanium.items;
      
      import fr.luvastv.deltanium.entities.EntityDynamite;
      import net.minecraft.creativetab.CreativeTabs;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.entity.projectile.EntitySnowball;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import net.minecraft.world.World;
      
      public class Dynamite extends Item
      {
          public Dynamite()
          {
              this.maxStackSize = 16;
          }
          public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
          {
              world.playSoundAtEntity(player, "random.tnt", 0.5F, 0.8F / (itemRand.nextFloat() * 0.4F + 0.8F));
      
              if (!world.isRemote)
              {
                  world.spawnEntityInWorld(new EntityDynamite(world, player));
                  –stack.stackSize; //erreur ici
              }
      
              return stack;
          }
      }
      
      1 Reply Last reply Reply Quote 0
      • robin4002
        robin4002 Administrateurs Rédacteurs Moddeurs confirmés last edited by

        Salut,
        Essaies plutôt avec stack.stackSize--;.

        Au passage, tu as oublié la balise de version.

        1 Reply Last reply Reply Quote 0
        • L
          LuvasTV last edited by

          C’est ça merci, passage en résolu

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Design by Woryk
          Contact / Mentions Légales / Faire un don

          MINECRAFT FORGE FRANCE © 2018

          Powered by NodeBB