Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. I'm not sure but I think you will need to override and rewrite some methods in your bow class.
  2. Where do you "create" and "shoot" the arrow?
  3. So what are you asking is why the arrow falls directly into the ground when it shoots.
  4. Have you change anything in onUpdate()
  5. You might have set the player's position to the arrow's pos somewhere in onHit().
  6. Have a look at this thread. Diesieben07 has explained clearly. https://www.minecraftforge.net/forum/topic/76564-1122-onitemrightclick
  7. I don't know about 1.14, but in 1.12.2 you use player.openGui() And ofc you need a registered gui class which represents what your GUI looks like and what it can do.
  8. What if you directly access from outside(folders) and do the changes instead of in the IDE?
  9. You haven’t define FACING variable in your block class and you need to add some other stuff as well.
  10. Just have a look at itemsword there is a float variable attackDamage, and in the constructor it assign the attackDamage from material +3 or something. Means if you extends the itemsword, you should be able to assign the damage in the constructor as well.
  11. You need an object to let the player open the GUI first, such as an item, a tileentity, or an entity. And when player do stuff with them, you show up GUI to them
  12. If you want to create an explosion after hitting something, and you have already extended EntityArrow, you should override the onHit() method and add some code to make it explode.
  13. I am going to create another class for the ammo thing, am I correct? Should I use events such as playertick or something like that?
  14. There is a float attackDamage in ItemSword.
  15. Here is the code ( I've deleted most of the stuff just to make it more clear) public int maxAmmo; public int ammo; public GunBase(String name, CreativeTabs creativetab, int maxAmmo) { super(name, creativetab); setMaxStackSize(1); this.maxAmmo = maxAmmo; this.ammo = maxAmmo; } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { EntityPlayer player = (EntityPlayer) entityIn; ItemStack itemstack = player.getHeldItemMainhand(); if(itemstack.areItemsEqual(itemstack, stack)) { NBTTagCompound compound; if (itemstack.hasTagCompound()) { compound = itemstack.getTagCompound(); } else { compound = new NBTTagCompound(); } compound.setInteger("MaxAmmo", this.maxAmmo); compound.setInteger("Ammo", this.ammo); stack.setTagCompound(compound); } } I've set maxammo and ammo in the constructor, aren't they going to have their own instance? There aren't any static method as well, but the result is same kind of item shares the nbt tag. How do I fix it?
  16. I don't know but "textures": { "particle": "block/cobblestone", "base": "block/cobblestone", "lever": "block/lever" }, "block" should be "blocks" isn't it If you are using your own texture you add your mod id in front of if
  17. Is it better to use events instead of onitemrightclick and onusingtick
  18. What I mean by doesnt stop isnt just about the animation, it also execute the code in the method. And I did use shouldCauseReequipAnimation and returned false but still not working
  19. After running a couple of times, I notice the problem is itemstack.damageItem(1, player); If I remove this line of code everything works again, but as soon as I add it in either onitemrightclick() or onusingitem() it acts weird, I think when Minecraft sets the item's damage it interrupts with the using method. Any way to solve this? I have tried to use setdamage instead of damageitem doesn't work either.
  20. @Override public void onUsingTick(ItemStack itemstack, EntityLivingBase entity, int count) { EntityPlayer player = (EntityPlayer) entity; if(fireAble(itemstack)) { fire(player.world, player, itemstack); } if (reloadAble((EntityPlayer) player, itemstack) && !(this.loading)) { reload(this.ammoType, (EntityPlayer) player, itemstack); } } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack itemstack = playerIn.getHeldItem(handIn); if(!worldIn.isRemote) { if(!playerIn.isHandActive()) { if (fireAble(itemstack)) { fire(worldIn, playerIn, itemstack); } if (reloadAble(playerIn, itemstack) && !(this.loading)) { reload(this.ammoType, playerIn, itemstack); } playerIn.setActiveHand(handIn); return new ActionResult<>(EnumActionResult.SUCCESS, itemstack); } } return new ActionResult<>(EnumActionResult.FAIL, itemstack); } I've written these codes. They work fine in the creative mode, the gun stopped fire when the right mouse button was released, but in survival mode, sometimes it just doesn't stop, the gun keeps fire although the player has released the mouse. What might cause this problem and how do I solve it?
  21. What I mean is is it possible to adjust the brightness of the torch corresponding to the gamma level.
  22. Minecraft.getMinecraft().gameSettings.gammaSetting
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.