IAttachmentHolder

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.neoforge.api.attachment.IAttachmentHolder;

Members

getAttachmentData(type as AttachmentType<T>) as T
script.zs
// IAttachmentHolder.getAttachmentData<T>(type as AttachmentType<T>) as T;
myIAttachmentHolder.getAttachmentData<T>(myAttachmentType);

Parameters:

type Type: AttachmentType<T>

Return Type: T

getAttachmentData(type as Supplier<AttachmentType<T>>) as T
script.zs
// IAttachmentHolder.getAttachmentData<T>(type as Supplier<AttachmentType<T>>) as T;
myIAttachmentHolder.getAttachmentData<T>(mySupplier);

Parameters:

type Type: Supplier<AttachmentType<T>>

Return Type: T

hasAttachmentData(type as AttachmentType<T>) as bool
script.zs
// IAttachmentHolder.hasAttachmentData<T>(type as AttachmentType<T>) as bool;
myIAttachmentHolder.hasAttachmentData<T>(myAttachmentType);

Parameters:

type Type: AttachmentType<T>

Return Type: bool

hasAttachmentData(type as Supplier<AttachmentType<T>>) as bool
script.zs
// IAttachmentHolder.hasAttachmentData<T>(type as Supplier<AttachmentType<T>>) as bool;
myIAttachmentHolder.hasAttachmentData<T>(mySupplier);

Parameters:

type Type: Supplier<AttachmentType<T>>

Return Type: bool

setAttachmentData(type as AttachmentType<T>, data as T) as T?
script.zs
// IAttachmentHolder.setAttachmentData<T>(type as AttachmentType<T>, data as T) as T?;
myIAttachmentHolder.setAttachmentData<T>(myAttachmentType, myT);

Parameters:

type Type: AttachmentType<T>
data Type: T

Return Type: T?

setAttachmentData(type as Supplier<AttachmentType<T>>, data as T) as T?
script.zs
// IAttachmentHolder.setAttachmentData<T>(type as Supplier<AttachmentType<T>>, data as T) as T?;
myIAttachmentHolder.setAttachmentData<T>(mySupplier, myT);

Parameters:

type Type: Supplier<AttachmentType<T>>
data Type: T

Return Type: T?