Started by
Aksumite
on
Topic category: Help with Minecraft modding (Java Edition)
I understand this has been asked before, but never (from what I know) the same problems as me.
I have a procedure that replaces the log with a stripped log, but the “on right clicked” event doesn’t allow for itemstack meaning it can’t damage the axe, which is very important.
The second (MUCH bigger) issue is that it doesn’t work with any axe. Is there custom code that can be used to include any axe, modded or vanilla? Thanks!
there is a get item in main hand procedure block.
Yes I know, but that doesn't work with every axe in every mod. I am wondering how (with custom code) to check if the player is holding ANY axe. I also have the issue that I can't damage the axe
I'll look in to it, and if it is possible to check if an itemstack is an axe I could add it to my plugin as a procedure block.
There is a damage item procedure block.
The plugin: https://mcreator.net/forum/62035/extraprocedures-plugin-11441152
Alright thanks
after a bit of tinkering, I found out that it is indeed possible:
this piece of code gets the item of the player's main hand and checks if it is an axe, if so, print in the console tool is and axe.
I'll add this to the plugin right now :D
Thanks so much! Just to be sure, where should I put this code? I have just recently started learning how to do custom code, so I am not exactly sure :D
I am assuming just "replacing" the if statement, am I correct?
(and then with the stuff I want to happen inside)
What I mean by replace is do I use this code instead of the original if statement, and then put what I want to happen in that? Sorry if that makes no sense
do not code if you don't understand java. I'll send you the plugin with the check for is tool axe in a few hours :D
Ok thanks, I really appreciate it :D
Took a whole day doing this but I believe that I got it working!
download
It works for checking swords, hoes, pickaxes, axes, and shovels. You need to replace this provided itemstack block with get item in entity main hand.
Install instructions: https://github.com/Max094Reikeb/ExtraProceduresPlugin/blob/master/README.md
only works for 2020.3
Wow, I REALLy appreciate it! You saved my mod!