right click entity makes explosion, but i don't want the explosion to hurt the player

Started by Willow markham on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
right click entity makes explosion, but i don't want the explosion to hurt the player

i made a weapon that upon right clicking causes a small explosion, however i dont want it to hurt the player, can somebody help me with this procedure?

Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Btw, projectiles start from…
Thu, 05/04/2023 - 17:38

Btw, projectiles start from coliding with shooter(shooting projectiles entity)
SO YOU TRIGGER HIT PROCEDURE WHEN YOU SHOOT.
Basicly you projectile and get shot and projectile keeps going.

maybe add some global player variables for explosion cooldown or something.

Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, I thouth you mean…
Thu, 05/04/2023 - 17:42

Sorry, I thouth you mean explosive projectile.

Ok, make player invulerable for the time of explosion and then make him(player) voulrable after explosion is done.