Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /customdrop [<text>] [<text>] [<text>]:
- permission: acd.admin
- permission message: &cYou do not permission to use this command.
- trigger:
- if arg-1 is not set:
- send "&cUsage: /customdrop <add|remove> <dropname> OR /customdrop drops"
- stop
- if arg-1 is not "add" or "remove" or "drops":
- send "&cUsage: /customdrop <add|remove> <dropname> OR /customdrop drops"
- stop
- if arg-1 is "add" or "remove":
- if arg-2 is not set:
- send "&cUsage: /customdrop %arg-1% <dropname>"
- stop
- if arg-3 is set:
- send "&cドロップアイテム名に空白は使用できません"
- stop
- if arg-1 is set:
- if arg-1 is "add":
- if {customdrops::%arg-2%} is set:
- send "&cドロップアイテム%arg-2%は既に存在しています"
- stop
- if player's tool is air:
- send "&cメインハンドに追加したいアイテムを持ってください"
- stop
- if player's tool is not air:
- set {customdrops::%arg-2%} to player's tool
- send "&e新しいドロップアイテム%arg-2%を追加しました"
- stop
- if arg-1 is "remove":
- if {customdrops::%arg-2%} is not set:
- send "&cドロップアイテム%arg-2%は存在しません"
- stop
- if {customdrops::%arg-2%} is set:
- delete {customdrops::%arg-2%}
- send "&eドロップアイテム%arg-2%を消去しました"
- stop
- else if arg-1 is "drops":
- if {customdrops::*} is not set:
- send "&c登録されているドロップアイテムはありません"
- else if {customdrops::*} is set:
- loop {customdrops::*}:
- set {_dropstext} to "&e%loop-index%"
- stop loop
- set {_loopnumber} to 0
- loop {customdrops::*}:
- add 1 to {_loopnumber}
- {_loopnumber} >= 2
- set {_dropstext} to "%{_dropstext}%&f, &e%loop-index%"
- send "&7Drops (%size of {customdrops::*}%): %{_dropstext}%"
- function getTags(tags: string) :: strings:
- replace "[""" and """]" in {_tags} with ""
- set {_returnvalue::*} to split {_tags} by ""","""
- return {_returnvalue::*}
- on death:
- victim is a living entity
- victim is not a player
- victim is not armor stand
- set {_tags::*} to getTags("%tag ""Tags"" of nbt of victim%")
- if {_tags::*} contain "only_custom_drop":
- clear drops
- loop {_tags::*}:
- set {_dropoption} to "{%loop-value%}"
- send "success" to attacker
- replace ";" in {_dropoption} with ","
- send "success" to attacker
- send "%{_dropoption}%" to attacker
- send "success" to attacker
- set {_customdropname} to tag "Drop" of {_dropoption}
- send "success" to attacker
- replace """" in {_customdropname} with ""
- send "success" to attacker
- set {_dropchance} to "%tag ""DropChance"" of {_dropoption}%" parsed as number
- send "success" to attacker
- set {_maxcount} to "%tag ""MaxCount"" of {_dropoption}%" parsed as integer
- send "success" to attacker
- set {_mincount} to "%tag ""MinCount"" of {_dropoption}%" parsed as integer
- send "success" to attacker
- set {_onlywhenkilledbyplayer} to "%tag ""OnlyWhenKilledByPlayer"" of {_dropoption}%"
- send "success" to attacker
- send "%{_onlywhenkilledbyplayer}%" to attacker
- if {_onlywhenkilledbyplayer} is "1b":
- send "success" to attacker
- attacker is a player
- chance of {_dropchance}%:
- loop random integer between {_maxcount} and {_mincount} times:
- if {customdrops::%{_customdropname}%} is set:
- drop {customdrops::%{_customdropname}%} at victim
- else if {customdrops::%{_customdropname}%} is not set:
- set {_dropitem} to {_customdropname} parsed as itemtype
- {_dropitem} is set
- drop {_dropitem} at victim
- else if {_onlywhenkilledbyplayer} is "0b":
- send "success" to attacker
- chance of {_dropchance}%:
- loop random integer between {_maxcount} and {_mincount} times:
- if {customdrops::%{_customdropname}%} is set:
- drop {customdrops::%{_customdropname}%} at victim
- else if {customdrops::%{_customdropname}%} is not set:
- set {_dropitem} to {_customdropname} parsed as itemtype
- {_dropitem} is set
- drop {_dropitem} at victim
- send "%tag ""Drop"" of {_dropoption}% %{_dropchance}% %{_maxcount}% %{_mincount}% %{_onlywhenkilledbyplayer}%" to attacker
Advertisement
Add Comment
Please, Sign In to add comment