插件手册:bossshop:conditions

这是本文档旧的修订版!


条件



您可以设置需要满足的条件才能将商店物品显示给玩家。设置条件非常简单。

  1. ShopName: 饥饿值条件
  2. DisplayName: '饥饿值条件'
  3. signs:
  4.   text: '[条件]'
  5.   NeedPermissionToCreateSign: true
  6. InventorySize: 45 #商店大小:45格
  7. shop:
  8.   5-1: #商店名:5-1
  9.   Condition: #调用条件
  10. - type:Hunger #调用饱食度
  11. - under:20 #要求低于20
  12.   RewardType: item
  13.   PriceType: free
  14.   Reward:
  15. - type:COOKED_CHICKEN
  16. - amount:1
  17.   MenuItem:
  18. - type:COOKED_CHICKEN
  19. - name:&9你饿吗?
  20. - 'lore:#&a你看起来很饿! #&a点击获得免费的寄肉!'
  21. - amount:1 #给予数量:1
  22.   InventoryLocation: 23 #位于格数:23
  23.   5: #商店名:5
  24.   RewardType: nothing
  25.   PriceType: free
  26.   MenuItem:
  27. - type:BARRIER
  28. - name:&9你饿吗?
  29. - 'lore:#&c你看起来不饿..#&c你饿了再来吧'
  30. - amount:1
  31.   InventoryLocation: 23

只有当玩家的饥饿值低于 20 时才会显示鸡肉商店物品,这意味着它会在玩家有任何饥饿值时显示(饥饿值 20 = 饥饿值条满)。否则将显示屏障。

条件在列表中设置。首先,您需要定义当前的条件类型,然后设置条件规则。您可以添加任意数量的条件。例子:

  1. Condition:
  2. - type:serverpinging #服务器ping
  3. - online:true #必须在线
  4. - over:200 #超过200
  1. Condition:
  2. - type:permission #权限
  3. - match:permission.node #权限节点
  1. Condition:
  2. - type:money #钱
  3. - over:1000 #超过2000
  4. - type:health #血量
  5. - between:5:15 #介于5-15

需要满足列表中的所有条件才能显示项目。如果所有条件之一为假,则该项目将被隐藏。例子:

  1. Condition:
  2. - type:money #钱
  3. - over:1000 #超过2000
  4. - type:health #血量
  5. - between:5:15 #介于5-15

在这里,玩家需要 5-15 的生命值和超过 1000 的钱才能显示该物品。

在“匹配”条件类型的情况下,可以使用可选条件:您可以列出不同的匹配值,用逗号分隔。如果其中一个值匹配,则条件返回 true,即使所有其他匹配值为 false。

  1. Condition:
  2. - type:group
  3. - match:group1,group2,group3,group4

如果您希望添加一些其他类型的条件,请告诉我。

BossShopPro按照配置中设置的顺序加载所有商店物品。如果商品的条件不满足,该商品将不会显示。在这种情况下,如果其他商店物品定义了相同的库存位置,则会改为显示。

  1. # 可能的条件类型和示例。
  2. 所有条件类型:
  3. - Money/Points
  4. - over:1000 (匹配任何 超过 1000 的余额 - vault 或 points插件)
  5. - under:500 (匹配任何 低于 500 的余额 - 保险库或积分插件)
  6. - equals:150 (Matches only a balance of 150 - vault or points plugin)
  7. - between:300:600 (Matches any balance between 300 and 600 - vault or points plugin)
  8. - ServerPinging
  9. - online:true (Matches if the server is succesfully pinged and online)
  10. - over:70 (Matches any player count over 70)
  11. - under:40 (Matches any player count under 40)
  12. - equals:500 (Matches only a player count of 500)
  13. - between:1:100 (Matches any player count between 1 and 100)
  14. - Permission
  15. - match:node.node (If this permission node is matched, it will be shown)
  16. - dontmatch:node.node (If this permission node is NOT matched, it will be shown)
  17. - Group
  18. - match:plus (Shows item if user is in group Plus)
  19. - dontmatch:vip (Shows item if user is NOT on group vip)
  20. - Item
  21. - match:stone (Shows item if user has stone in his inventory)
  22. - dontmatch:diamond (Shows item if user does not have diamonds in his inventory)
  23. - HandItem
  24. - match:stone (Shows item if user has stone in his main hand)
  25. - dontmatch:diamond (Shows item if user does not have diamonds in his main hand)
  26. - Health/Hunger/Exp
  27. - over:10 (Matches any health/hunger/exp level over 10)
  28. - under:5 (Matches any health/hunger/exp level below 5)
  29. - equals:15 (Matches exactly health/hunger/exp level of 15)
  30. - between:5:15 (Matches health/hunger/exp level between 5 and 15)
  31. - Time
  32. - over:4000 (Matches if the Minecraft day has passed 4000 ticks, from 0)
  33. - under:2000 (Matches if the Minecraft day has not passed 2000 ticks, from 0)
  34. - equals:8000 (Matches exactly 8000 Minecraft day ticks.. Not really useful)
  35. - between:12000:24000 (Matches if the Minecraft day is between 12000 and 24000 ticks)
  36. #RealDay = Day of year; RealWeekDay = Day of week, starting with monday = 1
  37. - RealYear/RealMonth/RealWeek/RealDay/RealWeekDay/RealHour/RealSecond/RealMillisecond
  38. - over:12 (Matches if value is higher than 12)
  39. - under:20 (Matches if value is lower than 20)
  40. - equals:11 (Matches if value is 11; Can be used for a christmas calendar for example or weekly rewards)
  41. - between:18:24 (Matches if value is between 18 and 24)
  42. - LightLevel
  43. - over:10 (Matches if light level is high)
  44. - under:6 (Matches if light level is low)
  45. - equals:15 (Matches if lightlevel is at maximum brightness)
  46. - between:8:14 (Matches if the light level is not sunlight but still high)
  47. - LocationX/LocationY/LocationZ (The Y coordinate determines the height of the player)
  48. - over:100 (Matches if coordinate of player is higher than 100)
  49. - under:50 (Matches if coordinate is lower than 50)
  50. - equals:1 (Matches if coordinate equals 1)
  51. - between:1:40 (Matches if coordinate is between 1 and 40)
  52. - World
  53. - match:worldname (Shows item if user is in world with name "worldname")
  54. - dontmatch:worldname (Shows item if user is in world with a name different from "worldname")
  55. - Weather
  56.   - match:storm (Matches if the weather is stormy. Opposite: match:clear)
  57. - dontmatch:storm (Matches if the weather is not stormy (=clear))
  • 插件手册/bossshop/conditions.1644127521.txt.gz
  • 最后更改: 2022/02/06 14:05
  • duangfafa