mojira.dev

wittiko

Assigned

No issues.

Reported

MC-278616 Modify Motion Data visual Desync from actual path Duplicate

Comments

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.