2

I'm creating a datapack (in Minecraft Java Edition 1.21) that allows me to fish in lava, and I've encountered a pretty annoying problem. When you cast the fishing rod, the bobber falls (sinks) to the bottom of the lava pool and might disappear due to distance from the player.

(Below is how I tried to solve my issue)

I thought that I could attach the bobber to an invisible armor stand that always stays in place so the bobber won't fall. But when I'm teleporting the armor stand to the bobber, the bobber doesn't attach. I've tried different coordinates, even when the bobber is right inside the armor stand or in a place where it should attach, but it doesn't. When I try teleporting the bobber to the armor stand, the bobber simply doesn't teleport and falls.

I need help, and if someone knows different ways to keep the bobber on top of the lava pool, I would like to hear them.

1 Answer 1

2

You can achieve that by teleporting the bobber some blocks above the armor stand. It does have a visual glitch where the bobber won't teleport (it does teleport, you can check that through its x/y/z coordinates), but as soon it touches the armor stand and attach to it, it will correct its position.

I found teleporting 1.6 blocks above a small armor stand to always work well. You can go as low as 1.3, but it may start missing the armor stand. I tested with 2.6 for normal armor stands.

Also, make sure to remove any motion it may have, to avoid the situations where you teleport the bobber upwards and it keeps moving foward.

Here is a minimal reproducible example:

execute as @e[type=minecraft:fishing_bobber] at @s if block ~ ~ ~ minecraft:lava run tag @s add inLava
execute as @e[type=minecraft:fishing_bobber, tag=!inLava2] at @s if block ~ ~ ~ minecraft:lava run data modify entity @s Motion set value [0.0d, -1.0d, 0.0d]
execute as @e[type=minecraft:fishing_bobber, tag=!inLava2] at @s if block ~ ~ ~ minecraft:lava run summon minecraft:armor_stand ~ ~ ~ {Small:1b}
execute as @e[type=minecraft:fishing_bobber, tag=!inLava2] at @s if block ~ ~ ~ minecraft:lava run tp ~ ~1.6 ~
execute as @e[type=minecraft:fishing_bobber, tag=inLava] run tag @s add inLava2
1
  • Thank you worked like a charm!
    – M1nd Brk
    Commented Aug 25 at 17:38

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.