插件永久免费
| 说明 | 内容 |
|---|---|
| 兼容版本 | 1.12.2+ (理论) |
| 硬依赖 | Pouvoir |
| 软依赖 | PlaceholderAPI Mythicmobs SkillAPI |
AttributeSystem 是基于 TabooLib VI & Pouvoir 编写的一款属性引擎插件
奉单一职责的宗旨,本引擎仅提供属性 属性读取 属性实现框架,具体属性与功能需要通过 配置 / API 来实现
AttributeSystem 提供包括但不限于以下API:
- AttributeSystemAPI
- AttributeManager
- ConditionManager
- EquipmentDataManager
- AttributeDataManager
- OperationManager
- RealizeManager
- ReadPatternManager
你可以通过编写代码/脚本来拓展AttributeSystem的诸多功能
Attribute.createAttribute("example", ReadGroup){names +="示例属性" }.register()varAttribute=find('com.skillw.attsystem.api.attribute.Attribute')varReadGroup=static('ReadGroup')//@Awake(Active)functionregAtt(){Attribute.createAttribute("example",ReadGroup,(builder)=>{builder.names.add("示例属性")}).register()}@AutoRegister object MyReadPattern : ReadPattern("my_read_pattern"){overridefunread(string:String, attribute:Attribute, entity:LivingEntity?, slot:String?): Status?{//code } overridefunreadNBT(map:Map<String, Any>, attribute:Attribute): Status?{//code } overridefunplaceholder(key:String, attribute:Attribute, status:Status, entity:LivingEntity?): Any?{//code } overridefunstat(attribute:Attribute, status:Status, entity:LivingEntity?): TellrawJson{//code } }//@ReadPattern(my_read_pattern)functionread(string,attribute,entity,slot){//code}functionreadNBT(map,attribute){//code}functionplaceholder(key,attribute,status,entity){//code}functionstat(attribute,status,entity){//code}@AutoRegister object LevelCondition : BaseCondition("level", setOf("Lv\\.(?<value>\\d+)", "等级限制: (?<value>\\d+)"), ConditionType.ALL){overridefuncondition(slot:String?, entity:LivingEntity?, matcher:Matcher, text:String): Boolean{entity ?:returntrueif (entity !isPlayer) returntrueval level =Coerce.toInteger(matcher.group("value")) return entity.level >= level } }varCoere=static('Coere')//@Condition(Level,ALL,Lv\.(?<value>\d+),等级限制: (?<value>\d+))functionlevel(slot,entity,matcher,text){varhasEntity=entity!="null"if(!hasEntity)returntrueif(!(entityinstanceofPlayer)){returntrue}varlevel=Coerce.toInteger(matcher.group("value"))returnentity.level>=level}WIKI www.skillw.com/docs/attsystem/intro
JavaDoc http://doc.skillw.com/attsystem/
MCBBS https://www.mcbbs.net/forum.php?mod=viewthread&tid=1307249