If the player damages Structure, attack it

Started by WELLOTHEHERO on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If the player damages Structure, attack it

I have a mob I'm making, if the player damages the Structure where this mob is located, I want the mob to attack her, how can I do that?

There is no way to do this;…
Fri, 07/09/2021 - 15:21

There is no way to do this; MCreator does not provide a way for the game to detect which blocks are part of a custom structure.

Joined Jan 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could try to create…
Mon, 07/19/2021 - 11:48

You could try to create every block as new, and then use "on block destroyed" for every single block Would be  time consuming tho

If you created structure…
Mon, 08/16/2021 - 17:56

If you created structure with only custom blocks (from your mod), you can add command after breaking each, adding effect with range (range should be high enough to reach whole structure). Let's call the effect "structure_break" and give it range of 50 blocks:

effect give @e[distance=..50] your_mod_id:structure_break 3

Then, let's make additional procedure returning true if that effect is applied on mob you want to attack, and put that procedure as "trigger" for this mob to become aggressive ^^
I hope it helps!