Change Creeper Explosion

Started by MamaLuigi on

Topic category: Help with modding (Java Edition)

Last seen on 15:01, 22. Jul 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change Creeper Explosion

I want to make a mod where any entities caught in the blast of a vanilla Creeper have something happen to them.

Heres how i want it to work: When a Creeper explodes, if any entity was near it, then have each of those entities run a procedure to themselves

Last seen on 18:36, 16. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I got something similar to…
Fri, 09/22/2023 - 03:34

I got something similar to this working where a creeper spreads moss on exploding. Make a procedure with the global trigger 'when explosion occurs,' and then check if there's a creeper in a very small radius. (Contrary to what the name implies, this procedure runs just before the explosion occurs- Which in basically all cases, will indicate it was a creeper that exploded.) Then, in the procedure, make an entity-iterator in a larger radius that runs your custom behavior for each entity. (Creeper blasts have about a 5 block radius, I think?) 

Last seen on 15:01, 22. Jul 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks! I'll try this
Sun, 09/24/2023 - 16:08

Thanks! I'll try this

Last seen on 15:01, 22. Jul 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so would i set the square…
Sun, 09/24/2023 - 16:28

so would i set the square cube to have a size of 5 or 2.5?

Last seen on 15:01, 22. Jul 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i forogt to mention, i want…
Sun, 09/24/2023 - 16:32

i forogt to mention, i want to make it so any entities caught in the blast get the strength effect, so how would i do this?

 

it would help if you could send a image of the procedure

Last seen on 18:36, 16. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, you want to make a new…
Sun, 09/24/2023 - 16:46

So, you want to make a new procedure. Where it asks for a global trigger at the top, choose 'when explosion occurs.'

Then, take an 'if' function, and have it check if 'entity exists in square cube of size (2) type (creeper)' You can find this function in the 'world' tab.

Inside the 'if' function, grab an entity iterator, also from the world tab. (It'll say 'for each entity as entity iterator at (x/y/z) in square cube of size (...).' Entity iterators take a position, and then executes something for each entity within its cube size, centered on its position. (So instead of just targeting one entity, it'll target everything in the cube. For an explosion, I use cube size 5- that is, 5 blocks in any direction from the explosion.)

To give stuff the strength effect, you would simply put 'Add potion effect (strength) to event/target entity' inside the entity iterator, but replace 'event/target entity' with 'entity iterator.' (You're not giving it an entity to apply strength to, but the entity iterator will apply strength to anything it finds inside the cube.) You can find potion functions in the 'entity management' tab, and 'entity iterator' in the 'minecraft components' tab. 

Last seen on 15:01, 22. Jul 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it worked! thanks!
Sun, 09/24/2023 - 17:57

it worked! thanks!