0

A current agenda I have is trying to figure out how to affect a specific item such as an arrow or a trident in Minecraft Bedrock.

If I wanted to make a thrown trident summon lightning bolts; I would do this in a command block:

/execute at @e[type=thrown_trident] run summon lightning_bolt ~ ~ ~

This would make the thrown trident summon lighting. My problem is that I don’t want all tridents to do this. I only want a specific trident to do this. I don’t care how to achieve this, I just need a specific trident to have this effect, not all tridents.

Please help me understand how I can achieve this.

1 Answer 1

1

First of all, the code you provided in the question is wrong, it will not summon lightning on the trident, it will summon it on the command block.

You should write:

/execute as @e[type=thrown_trident] at @s run summon lightning_bolt ~~~ 

But here is one more problem: when the trident strikes someone (building tree etc) it will keep summoning lighting until it's picked up. So to fix this you should write:

/execute as @e[type=thrown_trident] at @s if block ~~~ air run summon lightning_bolt ~~~

This will check if the block on which the trident is is air or not: if yes then lightning will summon, but if not (i.e. it strikes some block) lightning will stop.

Now let's come to your answer: if you want a specific trident to do this, then you should name that trident something else with anvil, then write this command in command block:

/execute as @e[type=thrown_trident,name="Lightning Trident"] at @s if block ~~~ air run summon lightning_bolt ~~~

Make sure to put quotes and write the name of your trident in them.
Thank me later.

1
  • Good answer! Although is there anyway I can prevent someone in survival from naming their trident and getting the same effect? Commented Jun 20, 2023 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.