-
Posts
1160 -
Joined
-
Days Won
7
Everything posted by poopoodice
-
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
I'm not sure but I think you will need to override and rewrite some methods in your bow class. -
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
Where do you "create" and "shoot" the arrow? -
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
So what are you asking is why the arrow falls directly into the ground when it shoots. -
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
No it isn't. -
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
Have you change anything in onUpdate() -
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
You might have set the player's position to the arrow's pos somewhere in onHit(). -
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.
-
You haven’t define FACING variable in your block class and you need to add some other stuff as well.
-
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.
-
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
-
[Solved] 1.12 how to create explosive arrow
poopoodice replied to NoobMaster4000's topic in Modder Support
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. -
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?
-
-
There is a float attackDamage in ItemSword.
-
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?
-
OnUsingTick() doesn't stop in survival gamemode 1.12.2
poopoodice replied to poopoodice's topic in Modder Support
Alright, thank you. -
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
-
OnUsingTick() doesn't stop in survival gamemode 1.12.2
poopoodice replied to poopoodice's topic in Modder Support
Is it better to use events instead of onitemrightclick and onusingtick -
OnUsingTick() doesn't stop in survival gamemode 1.12.2
poopoodice replied to poopoodice's topic in Modder Support
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 -
OnUsingTick() doesn't stop in survival gamemode 1.12.2
poopoodice replied to poopoodice's topic in Modder Support
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. -
@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?
-
What I mean is is it possible to adjust the brightness of the torch corresponding to the gamma level.
-
Minecraft.getMinecraft().gameSettings.gammaSetting