how do i prevent lighting from destroying items

Started by flexx1 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i prevent lighting from destroying items
Sun, 06/29/2025 - 06:49 (edited)

I have boss mobs that drop very important items, and the best method of killing them is with modded swords. These swords spawn lightning whenever they hit an entity. However, when you use those swords to kill the boss, I'm assuming the lightning destroys the item, because in testing, the items don’t spawn after the boss's death. Either the lightning is destroying the item, or something with the sword being modded is preventing the items from dropping. Any help is appreciated.

note that the bosses are also immune to lighting

Edited by flexx1 on Sun, 06/29/2025 - 06:49
Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try making a new procedure…
Tue, 07/01/2025 - 15:11

try making a new procedure and make it trigger when "Item is destroyed" then check if "itemstack = sword" and cancel it (Cancel event that triggered global trigger is in advanced tab)

there could be other stuff such as explosions or fire from the lightning breaking the items but that should hopefully fix it

(you can also make a custom tag and check if the itemstack is equal to the tag if you have alot of items that you dont want destroyed)