Added getAllNbt function to ScriptEntity.

This commit is contained in:
luisc committed 2021-10-19 14:48:59 -05:00
1 parent 40e738384f
commit b15f5221fd
1 file changed
+6
@@ -502,6 +502,12 @@ public class ScriptEntity<T extends Entity> implements IEntity {
return NpcAPI.Instance().getINbt(this.entity.getEntityData());
}
public INbt getAllNbt() {
NBTTagCompound compound = new NBTTagCompound();
this.entity.writeToNBT(compound);
return NpcAPI.Instance().getINbt(compound);
}
public void setNbt(INbt nbt) {
this.entity.readFromNBT(nbt.getMCNBT());
}