How to dectect if a thrown trident is enchanted with a custom enchantment (when it hits an entity)

Started by TheForgottenOne on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to dectect if a thrown trident is enchanted with a custom enchantment (when it hits an entity)
Sat, 06/06/2026 - 10:26 (edited)

I'm basically trying to make an enchant like fire aspect but for a trident so I would like to detect when a thrown trident hits an entity with this enchantment ant put the entity on fire but I was not able to figure it out, I know it may not be possible but I'm really desperate for a solution. I have no problem with doing custom code if it is the only alternative to my problem. 

(Using Mcreator 2025.3 and Neoforge 1.21.8)

Edited by TheForgottenOne on Sat, 06/06/2026 - 10:26
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You set an nbt onto the…
Mon, 06/08/2026 - 20:11

You set an nbt onto the trident when it spawns/thrown then you use another procedure to check when the trident deals damage to an entity, check that it has the nbt, then set on fire

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@fr6_17 Yeah but how to…
Tue, 06/09/2026 - 09:00

@fr6_17 Yeah but how to detect the trident entity when thrown and attach an nbt to this specific entity ?? I thought of the nbt already but was not able to figure that out...

Joined Jun 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Or just a few ticks before…
Tue, 06/09/2026 - 12:18

Or just a few ticks before the trident is thrown you could get the players inventory data and set an nbt tag to true. Then when it hits the entity it will check if the nbt tag is true and If the trident is enchanted then it will set them on fire

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found an alternative to…
Tue, 06/09/2026 - 16:07

I found an alternative to what I wanted to do at the beginning but I'll keep that in mind thanks !

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use on entity tick…
Sat, 06/13/2026 - 08:41

You can use on entity tick update, get entity iterator of size 2 or so, check for player, get item in main hand = the trident, set the nbt(s) from the enchants, remove the item in main hand ie the trident, apply the nbt to the trident entity being ticked then use a logic nbt to stop it from running this every tick and so it only runs it on the first tick