mojira.dev
MC-278352

Arrows and tridents appear at the wrong position when their Motion tag is modified every tick

Using commands to adjust an arrow or trident's Motion value once to accelerate the arrow causes it to appear as though it's flying in a slightly offset direction than where it actually lands.

How to reproduce:

For the following steps, replace all instances of arrow with trident to test the issue with tridents.

  1. Execute the following command:

    /scoreboard objectives add flying_timer dummy
  2. Place a repeating command block set to Always Active with the following command:

    /scoreboard players add @e[type=arrow] flying_timer 1
  3. Place another repeating command block set to Always Active and two chain command blocks set to Always Active chained to the repeating command block, with the following commands in them respectively:

    /execute as @e[type=arrow,scores={flying_timer=1}] store result entity @s Motion[0] double 0.0002 run data get entity @s Motion[0] 10000
    /execute as @e[type=arrow,scores={flying_timer=1}] store result entity @s Motion[1] double 0.0002 run data get entity @s Motion[1] 10000
    /execute as @e[type=arrow,scores=\{flying_timer=1}] store result entity @s Motion[2] double 0.0002 run data get entity @s Motion[2] 10000
  4. Shoot an arrow.

Expected result:

The arrow or trident would fly in the direction as the block it's about to hit.

Observed result:

The arrow or trident flies in a slightly offset direction, but ends up at the correct location when landing.

Linked issues

Attachments

Comments 6

I think it's a similar but different issue to MC-139548.

MC-139548 was an issue in 1.21.1 and earlier versions

but this issue was not an issue in 1.21.1. and earlier version.

and i don't use "data merge" commands, i use a "execute store result entity"

Please provide a clear way to reproduce this issue, including any necessary worlds or required setup. The commands are already attached and there is a video demonstrating the problem which is appreciated, but outlined steps to reproduce are also needed (for instance; it's unclear which commands go in what type of command block).

it's easy to reproduce this proplem. No special presets required
[step 1]
enter command "scoreboard objectives add flying_timer dummy"

[step 2]
use repeat command block & chain command block with unconditional and insert following command

scoreboard players add @e[type=arrow] flying_timer 1

execute as @e[type=arrow,scores={flying_timer=1}] store result entity @s Motion[0] double 0.0002 run data get entity @s Motion[0] 10000

execute as @e[type=arrow,scores={flying_timer=1}] store result entity @s Motion[1] double 0.0002 run data get entity @s Motion[1] 10000

execute as @e[type=arrow,scores={flying_timer=1}] store result entity @s Motion[2] double 0.0002 run data get entity @s Motion[2] 10000

 

[step3]
it's all!
If you shoot a crossbow or bow(with full power), you will notice that there are problems with arrow animation.

**"Motion[n] double 0.0002 run data get entity @s Motion[n] 10000" means a command that multiplies the arrow motion value by 2.

**it works correctly in 1.21.1 and previous version

I have recreated this issue in several ways via datapacks doing the following:

  1. create an enchantment that is triggering effects "minecraft:projectile_spawned"

    • type is set to "minecraft:run_function" and runs the following function

    • supported items can be a crossbow, or a bow

  2. function triggered by effect is as follows:

execute as @s store result entity @s Motion[0] double 0.0002 run data get entity @s Motion[0] 10000
execute as @s store result entity @s Motion[1] double 0.0002 run data get entity @s Motion[1] 10000
execute as @s store result entity @s Motion[2] double 0.0002 run data get entity @s Motion[2] 10000
  1. enchant crossbow or bow with enchant mentioned above

  2. charge and fire crossbow/bow

MY ENCHANT:

 

{
    "anvil_cost": 1,
    "description": {
        "translate": "arbalast"
    },
    "effects": {
        "minecraft:projectile_spawned": [
            {
                "requirements": {
                    "condition": "entity_properties",
                    "entity": "this",
                    "predicate": {}
                },
                "effect": {
                    "type": "minecraft:run_function",
                    "function": "test_enchants:ench/crossbow_test"
                }
            }
        ]
    },
    "max_cost": {
        "base": 16,
        "per_level_above_first": 10
    },
    "max_level": 1,
    "min_cost": {
        "base": 1,
        "per_level_above_first": 10
    },
    "slots": [
        "hand"
    ],
    "supported_items": "minecraft:crossbow",
    "weight": 10
}

 

Function in Datapack under FOLDER/data/test_enchants/function/ench/crossbow_test

execute as @s store result entity @s Motion[0] double 0.0002 run data get entity @s Motion[0] 10000
execute as @s store result entity @s Motion[1] double 0.0002 run data get entity @s Motion[1] 10000
execute as @s store result entity @s Motion[2] double 0.0002 run data get entity @s Motion[2] 10000

additionally, in the function, if a schedule function (or a repeating command block targeting arrows in the air) is included to display a particle at the arrows location the particles would be updated every tick in the correct location, but the arrow trail and animation would still go off into incorrect direction.

 

I have also repeated using a 3 repeating command block that was targeting arrows without a "speed" tag to apply individual motion index modifiers for motion[0] motion[1] and motion[2]. each repeating command block also had a chain command block that would tag the arrow with the "speed" tag and similar results apply.

 

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

youngju park

(Unassigned)

Confirmed

(Unassigned)

command

1.21.3, 24w46a, 1.21.4 Release Candidate 3

Retrieved