mob create explosion, cant make mob source of damage

Started by jeed_90 on

Topic category: Help with modding (Java Edition)

Last seen on 05:31, 19. Aug 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
mob create explosion, cant make mob source of damage
Tue, 07/23/2024 - 00:44 (edited)

mcreator 2024.1 minecraft 1.20.1

 

i wanna make a mob create an explosion but only affect everyone except him.

 

the everyone except him is done. but the explosions only say "player blew up" and i want "player blew up by monster"

is not just aesthetic because if other mob is affected, it will trigger the other mob, and also i like the aesthetic of the message not just you just die, how?, dunno.

 

summon explosion doesnt have a entity source so i cant

deal damage to (entity iteration) from sourse (damage source (explosion) caused by (event/target entity))    also doesnt work, maybe is a bug because it sounds like it should work.

"entity iteration" is the entitys in an range except source (this already works and all). "event/target entity" the enemy source.

 

if i use a projectile it could be the same or not sure, but making it explosion damage is impossible in a projectile directly

 

Can be any kind of explosion summon, or command, but i wanna know which entity caused, that way i can say if explosion is trying to damage entity_source = nel, and other mobs can target entity_source if affected.

Edited by jeed_90 on Tue, 07/23/2024 - 00:44
Last seen on 22:04, 6. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make a custom damage type…
Tue, 07/23/2024 - 01:15

make a custom damage type that is dealt to entities before your mob explodes (deal 1 damage of type: custom damage then wait 1 tick and summon explosion) example: https://imgur.com/7Mz4tSX , in that way you can make a procedure like: when an entity is hurt if  damage is type: custom damage do..... example: https://imgur.com/3alTWz6 

and in this way you can detect when an entity is damaged by your mob's explosion

 

After all of this the death message will be "player was blown up by mob" (I'm not really sure why but it works)

Last seen on 05:31, 19. Aug 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah it works, but by a…
Wed, 07/24/2024 - 00:47

yeah it works, but by a trick.

i got it working easy, i just use "PLAYER_EXPLOSION" is more like "any entity use explosion damage'

apparently deal damage  only "PLAYER_EXPLOSION" and "PLAYER_ATTACK" has the ability to have a entity source capability, also custom damage, thats why your idea work, but in my case is not necessary.

 

minecraft works by if you kill someone before 3 sec, any other damage is considered by them, so if you explode after getting hit, minecraft thinks its because of you, same thing happen if you fall die before a someone kills you, it would say something like "player fall try to escape from someone"(all this is something i remember years ago, i can be wrong)

 

so in my case is perfect because the damage is explosion(and also i wanna make sure explosion resistance works)

 

the only melee and explosion works im not sure how with fire or poison, wither etc.. 

also i didnt want to hit my own mob so i make him "inmmune to explosions"= true in nbt then ignore explosion damage if  "inmmune to explosions"= true just for couple of ticks.

but with your tip got it working, thanks:D

Last seen on 22:04, 6. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're welcome
Wed, 07/24/2024 - 00:53

You're welcome