A part Data piece can be added to a PartType to be able to add some MaterialPartData to MaterialParts created with Parts that are of this PartType.

Importing the package

Link to importing-the-package

It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import mods.contenttweaker.PartDataPiece;

Retrieving such an object

Link to retrieving-such-an-object

You can get a List of a Parts DataPieces using getData() on a Part.

Alternatively, you can register a new PartDataPiece using the MaterialSystem:

ZenScript
Copy
mods.contenttweaker.MaterialSystem.createPartDataPiece(String name, boolean required)

Parameters:

  • String name: The new PartDataPiece's name
  • boolean required: Is the PartDataPiece required to be present on a MaterialParts in order to register it?

You can retrieve the following information from a PartType:

ZenMethodReturn Type
ZenMethod
getName()
Return Type
string
ZenMethod
isRequired()
Return Type
string