服务端paper-1.19.2
有没有什么插件或者方法
可以让玩家死亡后掉落指定物品,比如这个物品含有特定的lore描述
世界默认死亡不掉落的,要求只掉落指定物品
有没有什么插件或者方法
可以让玩家死亡后掉落指定物品,比如这个物品含有特定的lore描述
世界默认死亡不掉落的,要求只掉落指定物品
建议找一个人定制插件,完全没听说过的功能
悬赏加到700金粒,我给你写一个
你好,我通过 Skript + SUPERLIB 完成该功能,望最佳
可通过 /bingdi reload 进行重载配置
复制代码
可通过 /bingdi reload 进行重载配置
- on load:
- load yaml "plugins/BingDi/config.yml" as "bingdi_config"
-
- if yaml value "death-enable" from "bingdi_config" is not set:
- set yaml value "death-enable" from "bingdi_config" to "true"
- if yaml value "death-world" from "bingdi_config" is not set:
- set yaml list "death-world" from "bingdi_config" to "world" and "world_the_enther"
- if yaml value "death-lore" from "bingdi_config" is not set:
- set yaml list "death-lore" from "bingdi_config" to "&a嘻嘻嘻" and "&a会掉落该物品"
-
- save yaml "bingdi_config"
- function has_world(p: player,w: strings) :: boolean:
- set {_world} to {_p}'s world
- if {_w::*} contains {_world}:
- return true
- else:
- return false
- return true
- function split_random(r: string) :: integer:
- set {_c::*} to {_r} split at "~"
- set {_c::1} to {_c::1} parsed as integer
- set {_c::2} to {_c::2} parsed as integer
- if {_c::1} is set:
- if {_c::2} is not set:
- set {_v} to {_c::1}
- else:
- set {_v} to random integer between {_c::1} and {_c::2}
- else:
- set {_v} to 0
- return {_v}
- on death:
- victim is player
-
- # 获取 yml 配置 , 掉落物品
- set {_e} to yaml value "death-enable" from "bingdi_config"
- set {_w::*} to yaml list "death-world" from "bingdi_config"
- set {_l::*} to yaml list "death-lore" from "bingdi_config"
- {_e} is true
- if has_world(victim,{_w::*}) is true:
- loop all items in victim's inventory:
- loop {_l::*}:
- set {_item} to loop-item
- set {_amount} to item amount of loop-item
- set {_lock::*} to loop-value-2 split at "##"
- set {_lock::1} to coloured {_lock::1}
- if lore of {_item} contains "%{_lock::1}%":
-
- set {_lock::2} to split_random({_lock::2})
- if {_amount} < {_lock::2}:
- remove {_amount} of {_item} from victim's inventory
- drop {_amount} of {_item} at victim's location
- else:
- remove {_lock::2} of {_item} from victim's inventory
- drop {_lock::2} of {_item} at victim's location
- delete {_names::*}
- delete {_l::*}
- command /bingdi [<text>]:
- trigger:
- if arg-1 is "reload":
- load yaml "plugins/BingDi/config.yml" as "bingdi_config"
- send "&f插件重载完毕"
- stop trigger
谢谢大佬