Change Creeper Explosion

Started by MamaLuigi on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 day ago
Joined Sep 2021
Points:
883

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 117
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

Active 3 weeks ago
Joined May 2022
Points:
1127

User statistics:

  • Modifications: 14
  • Forum topics: 23
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1140
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?) 

Active 1 day ago
Joined Sep 2021
Points:
883

User statistics:

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

Thanks! I'll try this

Active 1 day ago
Joined Sep 2021
Points:
883

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 117
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?

Active 1 day ago
Joined Sep 2021
Points:
883

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 117
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

Active 3 weeks ago
Joined May 2022
Points:
1127

User statistics:

  • Modifications: 14
  • Forum topics: 23
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1140
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. 

Active 1 day ago
Joined Sep 2021
Points:
883

User statistics:

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

it worked! thanks!