Prevent Player from Breaking Certain Blocks

Started by halfanatom on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Prevent Player from Breaking Certain Blocks

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!

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can't send a screen shot,…
Sun, 02/01/2026 - 13:59

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.