Skip to content

AttributeType

属性类型,非常重要的概念

插件默认属性类型在 cn.org.bukkit.craneattribute.core.attribute.AttributeTypes

注册属性类型

Kotlin
val CUSTOME_TYPE = AttributeType.create("CUSTOME_TYPE") {
    it.triggerSetting("配置key", "配置value", "注释")
}
CUSTOME_TYPE.register(触发器实例)
Java
AttributeType CUSTOME_TYPE = AttributeType.create("CUSTOME_TYPE");
CUSTOME_TYPE.triggerSetting("配置key", "配置value", "注释");
CUSTOME_TYPE.register(触发器实例)

这样就可以注册一个 CUSTOME_TYPE 属性类型了,将在触发器实例中编写触发,处理逻辑

触发器实例

移步 AttributeTrigger 查看