Damage splash procedure

Started by Sir_sassypants on

Topic category: Help with MCreator software

Last seen on 05:50, 2. Jun 2023
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Damage splash procedure

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

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you would have to code it…
Sun, 06/21/2020 - 05:24

you would have to code it with Java

Not in MCreator yet.

 

Last seen on 06:33, 1. May 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
when potion applied(instant…
Sun, 06/21/2020 - 08:36

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:

/effect give @e[r=22] damage_spash_procedure_issue_test_mod:CustomInstantDamage 0 255 true

 

Last seen on 05:23, 31. Jul 2023
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey, I tried this and it…
Fri, 07/17/2020 - 03:20

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?

Last seen on 06:33, 1. May 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
did it error or doesn't work…
Tue, 02/09/2021 - 07:47

did it error or doesn't work?

  • in case of error:check spelling
  • in case of ignoring command:check if coordinates are correct
  • in case of above not working:wait for me to figure it out or ask somebody else
Last seen on 08:14, 28. Nov 2023
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh yeah, this is really…
Wed, 02/10/2021 - 02:04

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 init entity spawn procedure

 

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.

when entity falls