Started by
halfanatom
on
Topic category: Help with Minecraft modding (Java Edition)
Hiya, is there any way I can prevent the player from breaking certain blocks like logs or stone with their main hand? By preventing I mean dealing damage or something, and if there is any way can you send me a screenshot of how to do it? Thanks!
I can't send a screen shot, but you could do a "when block is broken" procedure, and, for instance, make it stone. When block is broken, if block at XYZ= stone, deal x damage to source entity (or event/target I am not sure which), replace block at XYZ with lava (to incinerate the drop from the block), then replace block at XYZ with stone. I think that will work but no promises.
thanks, I
managed to do what I wanted but now i'd like it to deal damage every 20 ticks while breaking block
https://imgur.com/a/0UdxeeP this is the image link if it didn't show up properly
Unfortunately, I cannot see the link properly either, but I can walk you through part of the process: What you need is a variable, that when variable is at 20, it resets to 0 and does damage to the player. However, I am not rue how to make the variable go up by one every tick as they try to break the block.