Ars Magica: Legacy

Ars Magica: Legacy

142k Downloads

[Bug]: player_level_up advancement trigger doesn't fire

IchHabeHunger54 opened this issue ยท 1 comments

commented

Describe the bug

For testing purposes, I tried to confirm that the player_level_up trigger works, but unfortunately, it didn't. It probably needs to be fired somewhere.

Steps to Reproduce

  1. Put the following JSON in a datapack (for testing, it was done in arsmagicalegacy:advancements/test/root.json):
{
  "display": {
    "icon": {
      "item": "arsmagicalegacy:vinteum_dust"
    },
    "title": {
      "translate": "advancements.arsmagicalegacy.test.root.title"
    },
    "description": {
      "translate": "advancements.arsmagicalegacy.test.root.description"
    },
    "frame": "task",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false,
    "background": "arsmagicalegacy:textures/block/vinteum_ore.png"
  },
  "criteria": {
    "level": {
      "trigger": "arsmagicalegacy:player_level_up",
      "conditions": {
        "level": 2
      }
    }
  },
  "requirements": [
    [
      "level"
    ]
  ]
}
  1. Level up to level 2 through spellcasting or command and observe how absolutely nothing happens.

Expected behavior

The trigger should fire, which it does not.

Screenshots

No response

Version

1.18.2-1.0.1

Forge Version

40.0.18 (as used in version/1.18.x at the time of writing)

Other Mods

1.18.2-67-SNAPSHOT (as used in version/1.18.x at the time of writing)

Log

No response

commented

confirmed

fix: Insert the snippet at EventHandler#451

if (player instanceof ServerPlayer serverPlayer) {
    AMCriteriaTriggers.PLAYER_LEVEL_UP.trigger(serverPlayer, level);
}