Minecraft Java Edition – How to Detect When a Player Reels in a Fishing Rod

minecraft-commandsminecraft-java-edition

I'm working on a project that involves a player reeling in a fishing rod. I know that there is a scoreboard objective for casting one, but there seems to be no objective for reeling it back in.

Is it possible to detect if a player reels it in?

I'm on 1.14 version.

Best Answer

You can detect the presence of the fishing_bobber entity. For example you could give every player who cast a fishing rod a tag, then do something like this:

/execute at @a[tag=fishing] unless entity @e[type=fishing_bobber,distance=..32] run <command>

Keep in mind that reeling in is not the only way to trigger this, the player can also walk far away (32 blocks seems to be the distance at which the fishing stops), die, etc.

Related Topic