Is there any method to make a ranged item immune to lightning?

Started by Block_Legend001 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there any method to make a ranged item immune to lightning?

Mcreator 2023.1 forge 1.19.2 

Is there any method to make a ranged item immune to lightning?

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can create a placeholder…
Fri, 06/16/2023 - 04:47

You can create a placeholder item identical to the ranged item and set it to immune to fire. Then, in the procedures of the placeholder, create a procedure for "when item in inventory tick" and do the following steps:

  1. Remove 1 placeholder item from the player inventory 
  2. Add 1 ranged item to the player inventory

And also, summon the placeholder item before the lightening strikes or whatever you want to do with your mod.

So basically, when the ranged item gets destroyed, it gets changed into the placeholder, and when the player picks up the placeholder, it immediately gets changed back into the ranged item.

 

I hope this helps, and I'm sorry if this wasn't explained clearly or you do not understand. (I'm not good at explaining stuff lol)