Started by
Sir_sassypants
on
Topic category: Help with MCreator software
Simple question, possibly not simple answer
How would one create a procedure that when executed, will hurt all nearby entities. I want my mob to jump into the air and when landed will, well... hurt all nearby entities
On a side note if you know how to make it execute when it lands let me know
you would have to code it with Java
Not in MCreator yet.
when potion applied(instant potion,no bottles,called CustomInstantDamage),hurt target entity.
(don't know how code "when lands")
WHEN_LANDS_TRIGGER:execute command /effect give @e[r=RANGE] MODNAMESPACE:CustomInstantDamage 0 (DAMAGE IF AMPLIFIER USED IN PROCEDURE ELSE 0) true
example:
Hey, I tried this and it didn't work. I also tried doing it as a command and it didnt recognize [r=(whatever number I put)]. Im pretty sure the way to target entities in a radius was changed or something so if at all possible could you fix it?
did it error or doesn't work?
oh yeah, this is really interesting to make. luckily, the splash damage thing is now easily doable on MCreator 2020.5 using the "for each entity" procedure, which is a literal godsend imo.
since you want your mob to jump occasionally, here's something to begin with:
On entity initial spawn, add a number-type NBT tag with name "JumpCD" (or basically any name you want, just remember the name for it) for that entity with value of "200". this NBT tag will be the one to make your mob have to wait 200 ticks, which equals to 10 seconds, before it begins to do its special jump and damage splash attack. Now, add another NBT tag, same number type, but named "JumpWait", with value of "20". this one, on the other hand, will make your mob wait for a full second after its jump cooldown/recharge goes to 0 before jumping into the air. does it sound complicated as i say it? nah, it isn't. here's how it looks:
On entity tick update, if the current target of the mob equals the entities it acts aggressively against, (e.g. if it acts aggressively against players, villagers, and golems, and if its current target equals one of them) allow the mob to jump (increase its Y velocity), then set a logic-type NBT tag of that entity with name "HasJumped" to true while the mob's still mid air. you will now be setting up the cooldowns & conditions for its jump in this procedure, if you intend to use "set movement vector" procedure for jumping, as you wouldn't want your entity to jump every so often for its special attack. that'd be a disaster.
it should look something similar to this:
(sorry, the procedure was too long, but you can download the procedure template here: http://www.mediafire.com/file/s4cutey2eyzlb3h/jump_and_stomp_attack.ptpl/file)
When entity falls trigger: check if block at x, y-1, z (the block that the mob has landed on) is solid and if the mob's "HasJumped" NBT tag equals true. If both conditions are met, do a "for each entity as [entity iterator] at x y z in square cube with size [n]" procedure. if [entity iterator] is not a subtype of your mob, deal [n] damage to [entity iterator]. which means it'll deal the splash damage to nearby entities that are different from your mob. then, set its "HasJumped" NBT tag to false.