Started by
GafLord
on
Topic category: Help with Minecraft modding (Java Edition)
How to make it so that: Holding a certain object in your hand, HOLDING the left mouse button on a certain block, after a while, a certain object was changed to another object. Example: In the hand of an oak, start hitting the stone with an oak, after 3 seconds of beating the stone with an oak, the oak turned into oak boards
You could add a custom NBT number tag to the block that increases each time the block is hit, (assuming it's a modded block and you can enable block entity.) Then if the number gets high enough, replace the block. Another option is to just use a 'wait ... ticks' bracket to wait three seconds, (60 ticks), and then replace the block, if you don't care about the player actually holding down the mouse button.
For some good procedure tutorials, I recommend Northwesttrees gaming. You should be able to find 'em on Youtube, if you're interested.
You could also use a custom item with a NBT tag that checks the block you're hitting with it and changes the tag's value until the tag is at a certain value, then after the tag is at that value, changing the block (useful if the block's not custom, but the item is).