bingdi_
服务端paper-1.19.2
有没有什么插件或者方法
可以让玩家死亡后掉落指定物品,比如这个物品含有特定的lore描述
世界默认死亡不掉落的,要求只掉落指定物品

the7211sds
建议找一个人定制插件,完全没听说过的功能

Neige
悬赏加到700金粒,我给你写一个

九度世界
你好,我通过 Skript + SUPERLIB 完成该功能,望最佳
可通过 /bingdi reload 进行重载配置

  1. on load:

  2.         load yaml "plugins/BingDi/config.yml" as "bingdi_config"
  3.        
  4.         if yaml value "death-enable" from "bingdi_config" is not set:
  5.                 set yaml value "death-enable" from "bingdi_config" to "true"
  6.         if yaml value "death-world" from "bingdi_config" is not set:
  7.                 set yaml list "death-world" from "bingdi_config" to "world" and "world_the_enther"
  8.         if yaml value "death-lore" from "bingdi_config" is not set:
  9.                 set yaml list "death-lore" from "bingdi_config" to "&a嘻嘻嘻" and "&a会掉落该物品"
  10.        
  11.         save yaml "bingdi_config"

  12. function has_world(p: player,w: strings) :: boolean:

  13.         set {_world} to {_p}'s world
  14.         if {_w::*} contains {_world}:
  15.                 return true
  16.         else:
  17.                 return false
  18.         return true

  19. function split_random(r: string) :: integer:

  20.         set {_c::*} to {_r} split at "~"
  21.         set {_c::1} to {_c::1} parsed as integer
  22.         set {_c::2} to {_c::2} parsed as integer

  23.         if {_c::1} is set:
  24.                 if {_c::2} is not set:
  25.                         set {_v} to {_c::1}
  26.                 else:
  27.                         set {_v} to random integer between {_c::1} and {_c::2}
  28.         else:
  29.                 set {_v} to 0

  30.         return {_v}

  31. on death:

  32.         victim is player
  33.        
  34.         # 获取 yml 配置 , 掉落物品
  35.         set {_e} to yaml value "death-enable" from "bingdi_config"
  36.         set {_w::*} to yaml list "death-world" from "bingdi_config"
  37.         set {_l::*} to yaml list "death-lore" from "bingdi_config"

  38.         {_e} is true

  39.         if has_world(victim,{_w::*}) is true:

  40.                 loop all items in victim's inventory:

  41.                         loop {_l::*}:

  42.                                 set {_item} to loop-item
  43.                                 set {_amount} to item amount of loop-item
  44.                                 set {_lock::*} to loop-value-2 split at "##"

  45.                                 set {_lock::1} to coloured {_lock::1}

  46.                                 if lore of {_item} contains "%{_lock::1}%":
  47.                                        
  48.                                         set {_lock::2} to split_random({_lock::2})
  49.                                         if {_amount} < {_lock::2}:
  50.                                                 remove {_amount} of {_item} from victim's inventory
  51.                                                 drop {_amount} of {_item} at victim's location
  52.                                         else:
  53.                                                 remove {_lock::2} of {_item} from victim's inventory
  54.                                                 drop {_lock::2} of {_item} at victim's location

  55.                 delete {_names::*}
  56.                 delete {_l::*}

  57. command /bingdi [<text>]:
  58.         trigger:

  59.                 if arg-1 is "reload":

  60.                         load yaml "plugins/BingDi/config.yml" as "bingdi_config"
  61.                         send "&f插件重载完毕"
  62.                         stop trigger
  63.                
复制代码


m779064788
谢谢大佬

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