Started by
boynet
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a mod that prevents the player from destroying certain blocks with his own hands (like dirt and gravel). But I am not finding a way to do this with procedures.
Sample:
Your procedure is almost there. You just need to add the Cancel event that triggered global trigger block from the advanced tab inside your if statement and make the procedure trigger with the A block is broken global trigger.
Thanks very much :D
would there be any way of not showing that the block is being destroyed?
my procedure
I think this should be possible by putting the player into adventure mode and giving all the tools CanDestroy tags. I will further test this out and report back with a solution, hopefully soon.
That's a good point. You would need to be able to break wood to start to make any tools, and what you put there should work. This also highlights a problem with what I suggested for making the blocks not look like they are breaking when you can't break them. If the player is in adventure mode, they can't break any blocks unless they have a tool that has been told it can break a block. This seems to be possible to do if very complicated, but if the player doesn't have a tool, they simply can't break any blocks. Basically, there, unfortunately, doesn't seem to be any way to make the blocks not look like they are breaking using MCreator by itself.
how/where can i find the "is item in main hand shovel" etc?
and that cancel event that triggered global trigger?
Well, I don't know how to check if an item is a specific tool type, but the item in the main hand block is in the Entity procedures tab and the cancel event block is in the Advanced tab.
to check if item is a specific tool type use
is () of item type ()
Doing this without showing the breaking is super easy! Just do the code as stated in the response by willk55 (Cancel event that triggered global trigger), but instead of changing it to
A block is broken, just leave it at Player left clicks a block!