[email protected]
六维限制1:

    key: "力量要求"
    formats:
      - "{key}.*?@value"
    conditions:
      - check '%ap_liliang%' >= {value_min_0}
      - any [ check '{value_max_0}' == 'none' check '%ap_liliang%' <= {value_max_0} ]
    message: "&f你不满足 &6{item_name} &f物品的使用的力量要求"
format文件的这个词条为什么不生效是因为什么呀,就是限制好像没用。


-----------------------------------------------------------------------------------------------------------------------------------------------------
玩家攻击间隔这个属性低于0比如说-0.1就会刷屏报错,请教一下怎么解决,还有顺便请教一下,原作者大佬@夜雨晨风丶

var priority = 888
var combatPower = 5.0
var attributeName = "攻击间隔"
var attributeType = "ATTACK"
var placeholder = "custom_attack_time"

function onLoad(){
        Attr.setSkipFilter(true)
        return Attr
}

function runAttack(attacker, entity){
        //判断攻击者是否为玩家
        if (attacker.getType() == EntityType.PLAYER){
                //获取当前攻击间隔数值
                var value = Attr.getRandomValue(attacker) * 20
                //获取当前玩家手中的物品
                //判断"刷怪笼"是否在冷却
                if (attacker.getCooldown(Material.MOB_SPAWNER) != 0) {
                        //取消本次攻击
                        Attr.setCancelled(true)
                        attacker.sendMessage("§a体力恢复中!")
                }
                else{
                        //设置"手持物品"与"刷怪笼"冷却
                        var item = attacker.getItemInHand().getType()
                        attacker.setCooldown(Material.MOB_SPAWNER, value)
                        attacker.setCooldown(item, value)
                }
        }
        return false


夜雨晨风丶
有没有可能,你下面没写上
  1. #如果 custom-condition-component 配置项内
  2. #使用 AttributePlus 自带的变量时,需将变量配置进来
  3. cache-placeholder:
  4.   #- "attack"
  5.   - "combatPower"
  6.   - "liliang"
复制代码

至于脚本,加一行判断的事
  1. var value = Attr.getRandomValue(attacker) * 20
  2. if(value < 0) value = 0
复制代码



[email protected]
夜雨晨风丶 发表于 2023-6-28 13:10
直接这样写就完事了

至于脚本,加一行判断的事

感谢大佬

第一页 上一页 下一页 最后一页