I'm trying to make it so the right click will only work if they want it to, hence the enabled and disabled states.
What happens in game is shift right click does nothing at all, but the right click still makes the potion and durability parts happen. I can only assume this means it is not changing the NBT?
Some code is slashed out because it is not in use yet, I plan to use it later so active and inactive have different textures.
Rollback Post to RevisionRollBack
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
I'm pretty sure onItemRightClick is not invoked when right-clicking while shifting, so you'll have to hook into the right click event directly in another listener, and maybe call that method yourself or copy and paste it there.
I'm pretty sure onItemRightClick is not invoked when right-clicking while shifting, so you'll have to hook into the right click event directly in another listener, and maybe call that method yourself or copy and paste it there.
It's definitely called while the player is sneaking.
Rollback Post to RevisionRollBack
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
I'm pretty sure onItemRightClick is not invoked when right-clicking while shifting, so you'll have to hook into the right click event directly in another listener, and maybe call that method yourself or copy and paste it there.
I am 100% sure it does, not only have I seen it done in other code before, but just to double check i just now stuck it here
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
Dude I literally laughed out loud when I saw your post, such a flaw in logic on my part. Staring me down in the face.
Rollback Post to RevisionRollBack
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
I had seen the ? used once in another modder's code before, but I didn't know what it did at the time. I just did a quick google search, so basically what it is saying is, if true = true make it false, but if it doesn't equal true make it true?
Rollback Post to RevisionRollBack
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
The Meaning of Life, the Universe, and Everything.
Join Date:
5/28/2014
Posts:
285
Location:
USA
Minecraft:
TheUnderTaker11
Member Details
Alright thank you, I will make sure to remember that for later use.
Rollback Post to RevisionRollBack
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
Rather than using the ternary operator to negate a boolean, consider using the not operator (!).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Rather than using the ternary operator to negate a boolean, consider using the not operator (!).
In what way? I do not fully understand where you are suggesting the not operator would go to change the boolean?
Rollback Post to RevisionRollBack
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
If state is true, it becomes false. If state is false, it becomes true.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/28/2014
Posts:
285
Location:
USA
Minecraft:
TheUnderTaker11
Member Details
Wow, simple yet elegant, I am not very experienced so I was not aware you could use it in that way, also something I should stick in the memory bank.
Rollback Post to RevisionRollBack
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
Code is Here(relevant code anyways)
I'm trying to make it so the right click will only work if they want it to, hence the enabled and disabled states.
What happens in game is shift right click does nothing at all, but the right click still makes the potion and durability parts happen. I can only assume this means it is not changing the NBT?
Some code is slashed out because it is not in use yet, I plan to use it later so active and inactive have different textures.
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
I'm pretty sure onItemRightClick is not invoked when right-clicking while shifting, so you'll have to hook into the right click event directly in another listener, and maybe call that method yourself or copy and paste it there.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
It's definitely called while the player is sneaking.
Please don't PM me asking for help, I will just redirect you to the appropriate forum, where there are others who are far more skilled than me.
This is not the signature you are looking for.
Banners and such things
I am 100% sure it does, not only have I seen it done in other code before, but just to double check i just now stuck it here
if(player.isSneaking())
{
player.addPotionEffect((new PotionEffect(Potion.blindness.getId(), 400, 1)));
And it made me blind when I shift right clicked.
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
I might have been confused with onItemUsed then?
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
This is going to set your "state" key allways to true, no matter what it was before, why?
First of all you are checking if it is true, if it is you are setting it to false. Thas correct.
Now you are checking if it is false, if it is you are setting it to true
Seeing the problem?
You need to change that
Nice Greetings
TechMage66
Dude I literally laughed out loud when I saw your post, such a flaw in logic on my part. Staring me down in the face.
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
I had seen the ? used once in another modder's code before, but I didn't know what it did at the time. I just did a quick google search, so basically what it is saying is, if true = true make it false, but if it doesn't equal true make it true?
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
Alright thank you, I will make sure to remember that for later use.
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
The question mark and colon are the ternary operator.
Rather than using the ternary operator to negate a boolean, consider using the not operator (!).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
In what way? I do not fully understand where you are suggesting the not operator would go to change the boolean?
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!
If state is true, it becomes false. If state is false, it becomes true.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Wow, simple yet elegant, I am not very experienced so I was not aware you could use it in that way, also something I should stick in the memory bank.
Want a mod with the best magnets available? The download Better Magnets!
And if you like Avaritia then you will love More Avaritia! Adds recipes for creative items from a huge list of mods, and even adds more custom items that fit the Avaritia theme!