BoolData

Careful with BoolData: While it works for specifying boolean attributes in JSON syntax, using it in Tags will instead use a ByteData object. Reason for this is that Minecraft does not have Boolean NBT values.

导入相关包

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.

import crafttweaker.api.data.BoolData;

已实现的接口

BoolData implements the following interfaces. That means all methods defined in these interfaces are also available in BoolData

Constructor #构造函数

No Description Provided

new BoolData(internal as boolean) as BoolData
参数类型描述
internalbooleanNo Description Provided

Casters

方法

asCollection

Return Type: ICollectionData

BoolData.asCollection() as ICollectionData
true.asCollection();

asList #作为列表

获取列表 representation of this IData, returns null on anything but ListData.

Return Type: stdlib.List<IData>

BoolData.asList() as stdlib.List<IData>
true.asList();

asMap #作为地图数据

Gets a Map<String, IData> representation of this IData, returns null on anything but MapData.

Return Type: IData[string]

BoolData.asMap() as IData[string]
true.asMap();

contains #容器

Checks if this IData contains another IData, mainly used in subclasses of ICollectionData, is the same as an equals check on other IData types

Return Type: boolean

BoolData.contains(data as IData) as boolean
true.contains("Display");
参数类型描述
dataIData要检查是否有包含的数据

getByteData

Converts this BoolData to a ByteData object. This will be used when this Data is converted to NBT

Return Type: ByteData

BoolData.getByteData() as ByteData
true.getByteData();

getId #获取id

获取内部NBT标签的 ID。

用来确定哪些NBT类型被存储(例如在列表中)

Return Type: byte

BoolData.getId() as byte
true.getId();

getString #获取字符串

获取内部INBT标记的字符串表示形式

Return Type: string

BoolData.getString() as string
true.getString();