九度世界
Skript:
   采集农作物脚本,右键需要通过对准成熟农作物的情况下执行 ( 配好了成熟种类的 , 在 18 行 )                                                                                                                                                            但是对准的农作物周围如果有 种类不同  的农作物时,会随着变成 air 但并不会掉落,是被类似吞掉?

   恳求大佬解决问题。
    ( 注释有些忘记改了



  1. # 玩家道具指到农作物的位置 , 右键清除 4 格以内农作物 , 并随机掉落 {@Number} 里的数量


  2. options:
  3.         # 特定 Lore 才可进行以下操作
  4.         Lore: &f稿子
  5.         # 检测多少的格数
  6.         Radius: 4
  7.         # 掉落 1 ~ 5 的掉落物
  8.         Number: 4 to 10
  9.         # 删除多少的耐久
  10.         Durability: 1

  11. aliases:

  12.         # 设置成熟的材质都是为 ripe carrot plant  ,  其中 ripe ... plant 不变 , 自己把材质补上
  13.         
  14.         plant = ripe carrot plant, ripe wheat plant, ripe beetroot plant, ripe potato plant

  15. variables:

  16. # 道具耐久变量 不用管
  17.         {_ItemsDurability.%player%} = false



  18. on right click:

  19.         # 如果 Lore 包括 {@Lore} 里面的才可执行操作
  20.         if lore of player's tool contain "{@Lore}":
  21.         
  22.         
  23.                 # 循环玩家身边 4 格方块
  24.                 loop blocks in radius {@Radius} of block:
  25.                
  26.                         # 方块是耕地
  27.                         loop-block is farmland:
  28.                         
  29.                                 # 方块上面是植物需要设置 plant 里面的
  30.                                 block above loop-block is plant:
  31.                                        
  32.                                         set {_ItemsDurability.%player%} to true
  33.                                 
  34.                                         # 修改 {_type} 为循环 4
  35.                                         set {_location} to location above loop-block
  36.                                        
  37.                                         # 修改 {_location} 为循环 4 格的农作物
  38.                                         set {_type} to type of the block above loop-block
  39.                         
  40.                                         # 修改掉落的数量是 {@Number} 的设置数量
  41.                                         set {_drop} to random integer from {@Number}
  42.                                        
  43.                                         # 把右键的 4 格方块改为空白 也就是消除农作物
  44.                                         set block above loop-block to {_location}                             
  45.                                        
  46.                                         # 给予被消除的农作物 , 掉落到被删除的位置
  47.                                         drop {_drop} of {_type}                             
  48.                                        
  49.                                         # 如果觉得多余可直接删除
  50.                                         # send "&f采集成功! &a&o( %{_location}%                          
  51.                                        
  52.                                         send "&f采集成功! &a&o( %{_location}% )" # 提示采集的位置                             
  53.                                        
  54.                                         # 减少 1 的耐久
  55.                                         add {@Durability} to durability of player's tool                             
  56.                                        
  57.                                         # 如果耐久为 0 则删除该道具
  58.                                         if (max durability of player's tool - durability of player's tool) is equal to 0:                             
  59.                                                 delete player's tool                             
  60.                                        
  61.                                         # 设置 {_ItemsDurability::%player%} 方便损坏时给予提示
  62.                                                 set {_ItemsDurability::%player%} to true                             
  63.                                                 
  64.         # 工具损坏了的提示信息
  65.         if {_ItemsDurability::%player%} is true:
  66.         
  67.                 send "&f道具&e损坏&f了。"
  68.                
  69.                 set {_ItemsDurability::%player%} to false


  70.         
  71.                                        
  72.                         
复制代码







ZeroExact
本帖最后由 六月奈 于 2022-2-7 21:40 编辑

原封不动写进去后台报错无法掉落空气,怀疑是sk本身的判定bug
但是有个曲线救国的方法,取消alias,给四种植物分别写脚本即可

真的是稿子而不是镐子吗?(

  1. options:
  2.     Lore: &f镐子
  3.     Radius: 4
  4.     Number: 4 to 10
  5.     Durability: 1

  6. variables:
  7.     {_ItemsDurability.%player%} = false

  8. on right click:
  9.     if lore of player's tool contain "{@Lore}":
  10.         loop blocks in radius {@Radius} of block:
  11.             loop-block is farmland:
  12.                 block above loop-block is ripe wheat plant:
  13.                     set {_ItemsDurability.%player%} to true
  14.                     set {_location} to location above loop-block
  15.                     set {_type} to type of the block above loop-block
  16.                     set {_drop} to random integer from {@Number}
  17.                     set block above loop-block to {_location}                 
  18.                     drop {_drop} of wheat
  19.                     send "&f采集成功! &a&o( %{_location}% )" # 提示采集的位置                 
  20.                     add {@Durability} to durability of player's tool                 
  21.                     if (max durability of player's tool - durability of player's tool) is equal to 0:                 
  22.                         delete player's tool                 
  23.                         set {_ItemsDurability::%player%} to true

  24.                 block above loop-block is ripe carrot plant:
  25.                     set {_ItemsDurability.%player%} to true
  26.                     set {_location} to location above loop-block
  27.                     set {_type} to type of the block above loop-block
  28.                     set {_drop} to random integer from {@Number}
  29.                     set block above loop-block to {_location}                 
  30.                     drop {_drop} of carrot
  31.                     send "&f采集成功! &a&o( %{_location}% )" # 提示采集的位置                 
  32.                     add {@Durability} to durability of player's tool                 
  33.                     if (max durability of player's tool - durability of player's tool) is equal to 0:                 
  34.                         delete player's tool                 
  35.                         set {_ItemsDurability::%player%} to true

  36.                 block above loop-block is ripe beetroot plant:
  37.                     set {_ItemsDurability.%player%} to true
  38.                     set {_location} to location above loop-block
  39.                     set {_type} to type of the block above loop-block
  40.                     set {_drop} to random integer from {@Number}
  41.                     set block above loop-block to {_location}                 
  42.                     drop {_drop} of beetroot
  43.                     send "&f采集成功! &a&o( %{_location}% )" # 提示采集的位置                 
  44.                     add {@Durability} to durability of player's tool                 
  45.                     if (max durability of player's tool - durability of player's tool) is equal to 0:                 
  46.                         delete player's tool                 
  47.                         set {_ItemsDurability::%player%} to true  

  48.                 block above loop-block is ripe potato plant:
  49.                     set {_ItemsDurability.%player%} to true
  50.                     set {_location} to location above loop-block
  51.                     set {_type} to type of the block above loop-block
  52.                     set {_drop} to random integer from {@Number}
  53.                     set block above loop-block to {_location}                 
  54.                     drop {_drop} of potato
  55.                     send "&f采集成功! &a&o( %{_location}% )" # 提示采集的位置                 
  56.                     add {@Durability} to durability of player's tool                 
  57.                     if (max durability of player's tool - durability of player's tool) is equal to 0:                 
  58.                         delete player's tool                 
  59.                         set {_ItemsDurability::%player%} to true  
  60.                
  61.     if {_ItemsDurability::%player%} is true:
  62.         send "&f道具&e损坏&f了。"
  63.         set {_ItemsDurability::%player%} to false
复制代码

九度世界
六月奈 发表于 2022-2-7 21:37
原封不动写进去后台报错无法掉落空气,怀疑是sk本身的判定bug
但是有个曲线救国的方法,取消alias,给四种 ...

那可能是我个人糊涂的问题把 gao 没区分清楚

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