Skip to content

UnsafeValues#loadAdvancement doesn't calculate correct position for new advancement #9820

@Machine-Maker

Description

@Machine-Maker

Expected behavior

Either documentation or behavior regarding the position of any new advancement on the advancements screen.

Observed/Actual behavior

Any new advancement loaded via UnsafeValues#loadAdvancement is positioned in the top left (0, 0).

Steps/models to reproduce

this.getServer().getUnsafe().loadAdvancement(
    NamespacedKey.minecraft("adventure/spyglass_at_pig"),
    """
    {
      "parent": "minecraft:adventure/spyglass_at_parrot",
      "criteria": {
        "spyglass_at_pig": {
          "conditions": {
            "item": {
              "items": [
                "minecraft:spyglass"
              ]
            },
            "player": [
              {
                "condition": "minecraft:entity_properties",
                "entity": "this",
                "predicate": {
                  "type_specific": {
                    "type": "player",
                    "looking_at": {
                      "type": "minecraft:pig"
                    }
                  }
                }
              }
            ]
          },
          "trigger": "minecraft:using_item"
        }
      },
      "display": {
        "announce_to_chat": true,
        "description": {
          "text": "P I G"
        },
        "frame": "task",
        "hidden": false,
        "icon": {
          "item": "minecraft:spyglass"
        },
        "show_toast": true,
        "title": {
          "text": "Is It a Pig?"
        }
      },
      "requirements": [
        [
          "spyglass_at_pig"
        ]
      ]
    }
    """
);

Observe in the advancements display in the Adventure tab that the advancement is at the top left

Plugin and Datapack List

Test plugin to add advancement

Paper version

7e5dd92

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowThis issue only describes a minor inconvenience.status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: bugSomething doesn't work as it was intended to.

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions