[Fabric] Progressive Bosses

[Fabric] Progressive Bosses

194k Downloads

Breaks persistent data in KubeJS

Rad586 opened this issue ยท 0 comments

commented

Fabric, 1.19.2, ProgressiveBossesFabric-1.19.2-U2, KubeJS Fabric 1902.6.2-build.61
Persistent data of player in KubeJS is being reset on death.
This script may help testing:

EntityEvents.hurt(event => {
  const {source, server} = event;

  if(!source.actual) return;
  if(!source.actual.isPlayer()) return;

  if(!source.actual.persistentData.hurt) source.actual.persistentData.hurt = 0
  ++source.actual.persistentData.hurt;
  server.runCommand(`say ${source.actual.persistentData.hurt}`);
});

This script counts player's hit on entities and shows in chat, it shouldn't reset on death, unless there's no source.actual.persistentData.hurt.