CraftTweakerSavedData

Link to crafttweakersaveddata

Data that is saved and loaded with the world when it is saved and loaded from disk.

Saved Data is only on the server side, so you can only get it from a invalid.

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.world.CraftTweakerSavedData;

Extending SavedData

Link to extending-saveddata

CraftTweakerSavedData extends SavedData. That means all methods available in SavedData are also available in CraftTweakerSavedData

Name: getData

Return Type: MapData

ZenScript
Copy
// CraftTweakerSavedData.getData() as MapData

level.customData.getData();

Name: setData

Return Type: void

ZenScript
Copy
CraftTweakerSavedData.setData(data as MapData) as void
参数类型描述
参数
data
类型
MapData #地图数据
描述
No Description Provided

Name: updateData

Return Type: void

ZenScript
Copy
CraftTweakerSavedData.updateData(data as MapData) as void
参数类型描述
参数
data
类型
MapData #地图数据
描述
No Description Provided
名称类型可获得可设置描述
名称
data
类型
MapData #地图数据
可获得
true
可设置
true
描述
No Description Provided