差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
插件手册:bossshop:conditions [2022/02/06 10:21] – duangfafa | 插件手册:bossshop:conditions [2022/02/07 16:44] (当前版本) – [例子] duangfafa | ||
---|---|---|---|
行 9: | 行 9: | ||
您可以设置需要满足的条件才能将商店物品显示给玩家。设置条件非常简单。 | 您可以设置需要满足的条件才能将商店物品显示给玩家。设置条件非常简单。 | ||
- | **例子** | + | ===== 例子 |
<code yaml [enable_line_numbers=" | <code yaml [enable_line_numbers=" | ||
ShopName: 饥饿值条件 | ShopName: 饥饿值条件 | ||
行 33: | 行 33: | ||
- amount: | - amount: | ||
InventoryLocation: | InventoryLocation: | ||
+ | ExtraPermission: | ||
5: # | 5: # | ||
RewardType: nothing | RewardType: nothing | ||
行 43: | 行 44: | ||
InventoryLocation: | InventoryLocation: | ||
</ | </ | ||
+ | 只有当玩家的饥饿值低于 20 时才会显示鸡肉商店物品,这意味着它会在玩家有任何饥饿值时显示(饥饿值 20 = 饥饿值条满)。否则将显示屏障。 | ||
+ | {{: | ||
+ | ===== 结构 ===== | ||
+ | 条件在列表中设置。首先,您需要定义当前的条件类型,然后设置条件规则。您可以添加任意数量的条件。例子: | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type: | ||
+ | - online: | ||
+ | - over: | ||
+ | </ | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type: | ||
+ | - match: | ||
+ | </ | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type: | ||
+ | - over: | ||
+ | - type: | ||
+ | - between: | ||
+ | </ | ||
+ | ===== 规则 ===== | ||
+ | ==== AND ==== | ||
+ | 需要满足列表中的所有条件才能显示项目。如果所有条件之一为假,则该项目将被隐藏。例子: | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type: | ||
+ | - over: | ||
+ | - type: | ||
+ | - between: | ||
+ | </ | ||
+ | 在这里,玩家需要 5-15 的生命值和超过 1000 的钱才能显示该物品。 | ||
+ | ==== OR ==== | ||
+ | 在“匹配”条件类型的情况下,可以使用可选条件:您可以列出不同的匹配值,用逗号分隔。如果其中一个值匹配,则条件返回 true,即使所有其他匹配值为 false。 | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type:group | ||
+ | - match: | ||
+ | </ | ||
+ | ==== 可用的条件类型 ==== | ||
+ | 如果您希望添加一些其他类型的条件,请告诉我。 | ||
+ | BossShopPro按照配置中设置的顺序加载所有商店物品。如果商品的条件不满足,该商品将不会显示。在这种情况下,如果其他商店物品定义了相同的库存位置,则会改为显示。 | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | # 可能的条件类型和示例。 | ||
+ | 所有条件类型: | ||
+ | - Money/ | ||
+ | # 金钱 | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | - ServerPinging | ||
+ | # 延迟 | ||
+ | - online: | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | |||
+ | - Permission | ||
+ | # 权限 | ||
+ | - match: | ||
+ | - dontmatch: | ||
+ | |||
+ | - Group | ||
+ | # 权限组 | ||
+ | - match: | ||
+ | - dontmatch: | ||
+ | |||
+ | - Item | ||
+ | # 物品 | ||
+ | - match: | ||
+ | - dontmatch: | ||
+ | |||
+ | - HandItem | ||
+ | # 手中的物品 | ||
+ | - match: | ||
+ | - dontmatch: | ||
+ | |||
+ | - Health/ | ||
+ | # 血量/ | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | |||
+ | - Time | ||
+ | # 时间 | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | |||
+ | #RealDay = 一年中的一天; | ||
+ | # | ||
+ | - RealYear/ | ||
+ | # 匹配年/ | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | |||
+ | - LightLevel | ||
+ | # 光照亮度 | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | |||
+ | - LocationX/ | ||
+ | # 匹配 X,Y,Z | ||
+ | - over: | ||
+ | - under: | ||
+ | - equals: | ||
+ | - between: | ||
+ | |||
+ | - World | ||
+ | # 匹配世界 | ||
+ | - match: | ||
+ | - dontmatch: | ||
+ | |||
+ | - Weather | ||
+ | # | ||
+ | - match: | ||
+ | - dontmatch: | ||
+ | </ | ||
+ | ==== 占位符条件 ==== | ||
+ | 条件类型“placeholdernumber”和“placeholdermatch”允许检查任何BossShopPro或PlaceholderAPI支持的占位符并检查任何支持的插件的值。 | ||
+ | |||
+ | __占位符编号:__ | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | </ | ||
+ | |||
+ | __占位符匹配:__ | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | </ | ||
+ | 占位符中的冒号 (":" | ||
+ | |||
+ | **模支持** | ||
+ | |||
+ | 数值条件类型支持模。这是一个高级示例: | ||
+ | <code yaml [enable_line_numbers=" | ||
+ | Moving_1: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_2: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_3: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_4: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_5: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_6: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_7: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_8: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | Moving_9: | ||
+ | MenuItem: | ||
+ | - name:& | ||
+ | - type: | ||
+ | RewardType: NOTHING | ||
+ | PriceType: NOTHING | ||
+ | Message: '' | ||
+ | ExtraPermission: | ||
+ | InventoryLocation: | ||
+ | Condition: | ||
+ | - type: | ||
+ | - ' | ||
+ | </ | ||
+ | 这将生成一个动画项目,该项目将从插槽 1 移动到插槽 9,然后再次从插槽 1 开始。 | ||
+ | 将 "# | ||
+ | 例如,如果您使用条件类型“realsecond”并使用模“10”,则条件检查器收到的所有值都在 0 和 9 之间,因为“< | ||