AttributeInstance

Link to attributeinstance

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.entity.attribute.AttributeInstance;

Link to addPermanentModifier

Name: addPermanentModifier

Return Type: void

ZenScript
Copy
AttributeInstance.addPermanentModifier(modifier as AttributeModifier) as void
参数类型描述
参数
modifier
类型
AttributeModifier
描述
No Description Provided

Link to addTransientModifier

Name: addTransientModifier

Return Type: void

ZenScript
Copy
AttributeInstance.addTransientModifier(modifier as AttributeModifier) as void
参数类型描述
参数
modifier
类型
AttributeModifier
描述
No Description Provided

Name: getBaseValue

Return Type: double

ZenScript
Copy
// AttributeInstance.getBaseValue() as double

myAttributeInstance.getBaseValue();

Name: getModifier

Return Type: AttributeModifier

ZenScript
Copy
AttributeInstance.getModifier(uuid as string) as AttributeModifier
参数类型描述
参数
uuid
类型
string
描述
No Description Provided

Name: getModifiers

Return Type: stdlib.List<AttributeModifier>

ZenScript
Copy
// AttributeInstance.getModifiers() as stdlib.List<AttributeModifier>

myAttributeInstance.getModifiers();

Name: getValue

Return Type: double

ZenScript
Copy
// AttributeInstance.getValue() as double

myAttributeInstance.getValue();

Name: hasModifier

Return Type: boolean

ZenScript
Copy
AttributeInstance.hasModifier(modifier as AttributeModifier) as boolean
参数类型描述
参数
modifier
类型
AttributeModifier
描述
No Description Provided

Name: removeModifier

Return Type: void

ZenScript
Copy
AttributeInstance.removeModifier(modifier as AttributeModifier) as void
参数类型描述
参数
modifier
类型
AttributeModifier
描述
No Description Provided

Name: removeModifier

Return Type: void

ZenScript
Copy
AttributeInstance.removeModifier(uuid as string) as void
参数类型描述
参数
uuid
类型
string
描述
No Description Provided

Name: setBaseValue

Return Type: void

ZenScript
Copy
AttributeInstance.setBaseValue(value as double) as void
参数类型描述
参数
类型
双精度
描述
No Description Provided
名称类型可获得可设置描述
名称
baseValue
类型
双精度
可获得
true
可设置
true
描述
No Description Provided
名称
modifiers
类型
stdlib.List<AttributeModifier>
可获得
true
可设置
false
描述
No Description Provided
名称
类型
双精度
可获得
true
可设置
false
描述
No Description Provided