How do i make a structure with vanilla blocks and of you brake a block you get damage?

Started by HappyFew09 on

Topic category: Help with modding (Java Edition)

Last seen on 17:56, 24. Aug 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i make a structure with vanilla blocks and of you brake a block you get damage?

I want to make a structure with vanilla blocks, but if you break a block you get damage. Idk how to do it. Does anyone have a idea?

Last seen on 00:07, 8. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You'd need to have some way…
Thu, 06/15/2023 - 12:50

You'd need to have some way to detect if the blocks are part of your structure or not.

This could be done with just one modded block and a status effect. Put that block in the middle of your structure, and use procedures to make it give the status effect to nearby players every update tick. Set it's tick rate to 20.

Then, make a procedure with global trigger "block broken." Do "if event/target entity has <the status effect>, do <pick a number> damage event/target entity type <pick a type; I recommend magic so armor doesn't work>." Optionally, you can include a cancel event trigger to make the block fix itself.

Last seen on 00:07, 8. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, if you have problems…
Thu, 06/15/2023 - 12:51

Also, if you have problems with the status effect sticking around at 0:00 forever, change the "give player status effect" block to "execute command '/effect give @s <mod_namespace>:<status_effect> 1' in the name of event/target entity"

Last seen on 17:56, 24. Aug 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thnx, this helped me alot!
Fri, 06/16/2023 - 10:38

thnx, this helped me alot!