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)

Active 10 months ago
Joined Nov 2020
Points:
548

User statistics:

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

Active 1 year ago
Joined Jun 2023
Points:
117

User statistics:

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