CraftTweaker

CraftTweaker

151M Downloads

Failure to cast IData to string

LoosiusGoosius opened this issue ยท 1 comments

commented

Issue description

I have been working with blockgoblin31 on your discord with creating a script that allows a players nbt data to be copied back to them after death. The script is possibly not working, but in trying to use println to see what is being passed through, it throws an error

Steps to reproduce

No response

Script used

https://pastebin.com/a7DjyW4d

The crafttweaker.log file

https://pastebin.com/PhXSX0MZ

Minecraft version

1.19

Modloader

Forge

Modloader version

43.3.2

CraftTweaker version

10.1.50

Other relevant information

Minecraft version is 1.19.2

The latest.log file

https://pastebin.com/3yBSEjxe

commented

Sorry this took so long to look at, the error is on line 15 and 16:

        var infection = player.getData()["infectionProgression"];
        player.updateData({"infectionSave": infection});

the player doesn't have data at infectionProgression, so it returns null, I've fixed this in 1.20.1, however you can solve this on your version by checking if the player data contains the key before setting it / removing it if the current value is null