Spectrum

Spectrum

2M Downloads

[BUG] JsonNBT does not work with Motion and Passengers nbt tag in entity fishing

Kisuny opened this issue · 4 comments

commented

Describe the bug
When u try add nbt tag motion or Passengers in entity fishing it just doesn't work.

Expected behavior
Motion tag increases the initial velocity of the summoned mob, but it is doesn't work with Json NBT and string nbt in Entity fishing

I've tried different variations of JsonNBT {"Motion":["0.5b","0.5b","0.5b"]} and {"Motion":["0.5","0.5","0.5"]} and {"Motion":[0.5,0.5,0.5]} and just string nbt: "nbt": "{Motion:[0.8,0.5,0.5]}" none of this is working. A similar problem with Passengers tag.
Mod version
spectrum-1.7.3-deeper-down (mc 1.19.2)

Video
https://www.youtube.com/watch?v=DuBxeHCIHZo

One example of entity fishing

This example works, except for one tag (Motion)

  {
    "location": {
      "dimension": {
        "worlds": [
          "minecraft:overworld"
        ]
      },
      "fluid": {
        "tag": "minecraft:lava"
      }
    },
    "dimension": "minecraft:overworld",
    "chance": 1.0,
    "entities": [
      {
        "id": "minecraft:wither_skeleton",
        "weight": 5,
        "nbt": {
          "Health": 40,
          "CustomName": "{\"text\":\"Зубастик\",\"color\":\"light_purple\"}",
          "HandItems": [
            {
              "id": "spectrum:dreamflayer",
              "Count": 1
            },
            {
              "id": "air",
              "Count": 1
            }
          ],
          "ArmorItems": [
            {
              "id": "minecraft:leather_boots",
              "tag": {
                "display": {
                  "color": 4473924
                }
              },
              "Count": 1
            },
            {
              "id": "minecraft:leather_leggings",
              "tag": {
                "display": {
                  "color": 2368548
                }
              },
              "Count": 1
            },
            {
              "id": "minecraft:leather_chestplate",
              "tag": {
                "display": {
                  "color": 3421236
                }
              },
              "Count": 1
            },
            {
              "id": "minecraft:player_head",
              "tag": {
                "SkullOwner": {
                  "Id": [
                    "I;",
                    -109108388,
                    -1927723097,
                    -1379622602,
                    -214183573
                  ],
                  "Properties": {
                    "textures": [
                      {
                        "Value": "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQzMjgzYzBiM2ZiMmJmZDc1OWU3MTA1YzkyYWFhZDA1MjcxNjkwMWMyMWM1OTI1YjI3OTc1MTg1MWQ3NGM3OSJ9fX0="
                      }
                    ]
                  }
                }
              },
              "Count": 1
            }
          ],
          "HandDropChances": [
            "0F",
            "0F"
          ],
          "ArmorDropChances": [
            "0F",
            "0F",
            "0F",
            "0F"
          ],
          "ActiveEffects": [
            {
              "Id": 13,
              "Duration": 10000,
              "ShowParticles": "0b"
            },
            {
              "Id": 30,
              "Duration": 100000,
              "ShowParticles": "0b"
            }
          ],
          "DeathLootTable": "kubejs:mobs/ditcher",
          "Motion": [
            "0.5b",
            "0.5b",
            "0.5b"
          ]
        }
      }
    ]
  }
commented

Entity fishing uses vanilla spawn egg mechanics, but it looks like spawn eggs are not able to spawn passengers.
Here is the mojang bug tracker entry: https://bugs.mojang.com/browse/MC-85340
Once that is fixed, entity fishing will support passengers, too.

Will add the velocity change, as proposed by @imreallybadatnames

commented

And for the passengers, I might have to call spawnEntityAndPassengers() instead of spawnEntity(). Will test.

commented

according to this line in SpectrumFishingBobberEntity, the entity velocity is overridden, ignoring the Motion NBT tag.

commented

The easiest fix would be to use entity.addVelocity instead.