Origins (Fabric)

Origins (Fabric)

17M Downloads

Powers Granted by origins:grant_power Disappear Upon Reloading the Save

GRAINALCOHOL opened this issue ยท 6 comments

commented

When using the origins:grant_power action type, I observed that powers granted to players are lost after exiting and reloading the save. After successfully applying the power, I checked the player's NBT data and confirmed that both the power and its source were correctly stored and functional. However, upon re-entering the save, the NBT data no longer contained the granted power or its source. Notably, this issue does not affect powers assigned by the origin itself.

commented

I have an idea on why this happens, but just to make sure, you'll have to be more specific;

  • How are you granting the power itself?
  • What source are you using to grant the power? Are you using the ID of the origin or an arbitrary one?
  • Are there any errors in the output log?
commented

I discovered another problem: After using origins:revoke_power to remove a power, reloading the save causes the revoked power to be restored (re-granted).

In addition, Regarding your questions:

  • I used origins:active_self and origins:grant_power to grant the player a power (I also tested origins:action_on_callback, and the issue still occurs).
  • I can confirm that I filled in correct and valid power and source fields (they are from my own mod).
  • No, I thoroughly checked the console and attempted to use Mixin to output more information, but all efforts failed.

Later, I conducted further tests and found that /power grant and /power revoke do not exhibit the aforementioned issues.

Below is the JSON field I used when testing with origins:active_self. Hope this helps (oap is my modโ€™s modid):

{
  "name": "a name",
  "description": "test grant_power",
  "type": "origins:active_self",
  "entity_action": {
    "type": "origins:grant_power",
    "power": "oap:test_countdown/test_power_8",
    "source": "oap:test_countdown"
  },
  "cooldown": 10,
  "key": {
    "key": "key.origins.primary_active"
  }
}
commented

By the way, I am using fabric1.20.1, and the origins version is 1.10.0

commented

This problem is very serious for datapack production, I hope it can be fixed even sooner

commented

Can you provide the data pack? This isn't really an issue that can be fixed easily, especially when everything looks fine at a glance and there's little to no information to work with

commented

Of course, but I haven't localized it for other languages yet - only Simplified Chinese (zh_cn) is available. I'll upload it along with the rest.

OrigincraftOrigins.zip

zh_cn.json