[SOLVED] Be immune to lightning for player

Started by Gavydog on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] Be immune to lightning for player
Wed, 06/24/2020 - 11:57 (edited)

Yeah, so I have this axe which summons lightning when you attack a mob, but the lightning damages the player also. Any way to stop the player from being damaged? 

Also if this is possible I would like the lightning bolt to not cause fire. Thx!

Edited by Gavydog on Wed, 06/24/2020 - 11:57
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
 do something like this: …
Mon, 06/22/2020 - 19:16

 do something like this:

https://cdn.discordapp.com/attachments/599250311852458006/724703022575517756/unknown.png

the 1st text field text is: "LivingAttackEvent  event = (LivingAttackEvent)dependencies.get("event");"

the 2nd text field is: "if (event.getSource() != null && event.getSource() == DamageSource.LIGHTNING_BOLT) "

also replace the wooden axe with your custom axe.

this makes all players immune to lightning if he has that axe in main hand.

 

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Where am I supposed to put…
Tue, 06/23/2020 - 00:35

Where am I supposed to put this? Because after I put this code I was followed by infinite lightning :/

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait actually now it doesnt…
Tue, 06/23/2020 - 00:49

Wait actually now it doesnt but i still take lightning damage.

Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ahznb, wow nice, with this,…
Tue, 06/23/2020 - 04:49

Ahznb, wow nice, with this, you will be able to make a plugins about making player immune to many kinds of damages?

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
create a new procedure…
Tue, 06/23/2020 - 07:23

create a new procedure element and put that in. also note in the top green block, the global trigger is "Entity attacked"

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yes. but note that this is…
Tue, 06/23/2020 - 07:26

yes. but note that this is for 1.12.2. i don't know if 1.15.x changed it or not

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh maybe thats why im using…
Tue, 06/23/2020 - 08:03

Oh maybe thats why im using 1.15.2

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But here's my scipts
Tue, 06/23/2020 - 08:10

But here's my scipts

Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, I tried 1.15.2 and it's…
Tue, 06/23/2020 - 11:18

No, I tried 1.15.2 and it's still working tho

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Then is my scripts wrong
Tue, 06/23/2020 - 12:00

Then is my scripts wrong

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ahznb Does it matter if the…
Wed, 06/24/2020 - 00:01

ahznb Does it matter if the current entity is replaced by source entity is it the same. Cuz Idk what's wrong

Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You only use Source Entity…
Wed, 06/24/2020 - 03:53

You only use Source Entity when you hit other entities, but in this case, the lighting damages the entities not you So use Current Entity

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
are you calling that…
Wed, 06/24/2020 - 05:41

are you calling that procedure from somewhere? because you shouldn't call it, just create the procedure and don't call it anywhere.