Started by
TheForgottenOne
on
Topic category: Help with Minecraft modding (Java Edition)
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
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
@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...
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
I found an alternative to what I wanted to do at the beginning but I'll keep that in mind thanks !
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