Started by
WELLOTHEHERO
on
Topic category: Help with Minecraft modding (Java Edition)
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?
Topic category: Help with Minecraft modding (Java Edition)
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; MCreator does not provide a way for the game to detect which blocks are part of a custom structure.
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 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!