Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers

PartDataPiece

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

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

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

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

script.zs
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?

ZenMethods

You can retrieve the following information from a PartType:

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