Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getTagValues(e: entity) :: strings:
- set {_tagnbt} to "%tag ""Tags"" of nbt of {_e}%"
- replace "[""" and """]" in {_tagnbt} with ""
- return split {_tagnbt} by ""","""
- function getLivingEntityFromUUID(uuid: text) :: living entity:
- loop all entities:
- if UUID of loop-entity is "%{_uuid}%":
- return loop-entity
- stop loop
- function deleteBossBar(bossbar: string):
- evaluate "remove all players from bar %{_bossbar}%"
- evaluate "delete %{_bossbar}%"
- function removePrefix(str1: string, str2: string) :: string:
- first length of {_str2} characters of {_str1} is {_str2}
- return last length of {_str1} - length of {_str2} characters of {_str1}
- function getMobTypeName(e: entity) :: string:
- set {_name} to "%{_e}.getType()%" in lower case
- replace "_" in {_name} with " "
- set {_splits::*} to {_name} split by ""
- set {_size} to size of {_spilts::*}
- delete {_splits::%{_size}%}
- set {_splits::1} to {_splits::1} in upper case
- loop {_splits::*}:
- set {_num} to loop-index parsed as integer - 1
- {_splits::%{_num}%} is " "
- set {_splits::%loop-index%} to {_splits::%loop-index%} in upper case
- return join {_splits::*}
- #Spawn Mob
- function spawnOriginalMob(id: string, loc: location, amount: integer, mythic: boolean):
- if {_mythic} is true:
- loop {_amount} times:
- spawn mythicmob {_id} at {_loc} with level 1
- if {_mythic} is false:
- {originalmob::%{_id}%} is set
- loop {_amount} times:
- spawn {originalmob::%{_id}%} at {_loc}
- add "{Tags:[""originalmob:%{_id}%""]}" to nbt of last spawned entity
- if {originalmobnbt::%{_id}%} is set:
- add {originalmobnbt::%{_id}%} to nbt of last spawned entity
- if {originalmobhealth::%{_id}%} is set:
- set max health of last spawned entity to {originalmobhealth::%{_id}%}/2
- set health of last spawned entity to {originalmobhealth::%{_id}%}/2
- if {originalmobname::%{_id}%} is set:
- set name of last spawned entity to {originalmobname::%{_id}%}
- if {originalmobexp::%{_id}%} is set:
- add "{Tags:[""exp%{originalmobexp::%{_id}%}%""]}" to nbt of last spawned entity
- command /originalmob <text> <boolean> <integer>:
- permission: originalmob.admin
- permission message: &cYou do not have permission to use this command!
- usage: /originalmob <ID> <ismythicmob> <amount>
- trigger:
- spawnOriginalMob(arg-1, location of player, arg-3, arg-2)
- on tab complete:
- set {_splits::*} to split event-string by " "
- {_splits::1} is "/originalmob"
- if size of {_splits::*} is 2:
- delete completions
- if {_splits::2} is "":
- loop {originalmob::*}:
- add loop-index to completions
- else:
- loop {originalmob::*}:
- first length of {_splits::2} characters of loop-index is {_splits::2}
- add loop-index to completions
- else if size of {_splits::*} > 2:
- cancel event
- #Custom Drop
- 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}%"
- on death:
- victim is a living entity
- victim is not a player
- victim is not armor stand
- set {_tags::*} to getTagValues(victim)
- if {_tags::*} contain "CustomDropOnly":
- clear drops
- loop {_tags::*}:
- set {_dropoptions::*} to loop-value split by ";"
- loop {_dropoptions::*}:
- if removePrefix(loop-value-2, "Drop:") is set:
- set {_customdropname} to removePrefix(loop-value-2, "Drop:")
- if removePrefix(loop-value-2, "DropChance:") is set:
- set {_dropchance} to removePrefix(loop-value-2, "DropChance:") parsed as number
- if removePrefix(loop-value-2, "MinCount:") is set:
- set {_mincount} to removePrefix(loop-value-2, "MinCount:") parsed as integer
- if removePrefix(loop-value-2, "MaxCount:") is set:
- set {_maxcount} to removePrefix(loop-value-2, "MaxCount:") parsed as integer
- if removePrefix(loop-value-2, "RareDrop:") is set:
- set {_raredrop} to removePrefix(loop-value-2, "RareDrop:") parsed as boolean
- {_customdropname} is set
- {_dropchance} is set
- {_mincount} is set
- {_maxcount} is set
- {_raredrop} is set
- if {_raredrop} is true:
- 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 {_raredrop} is false:
- 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
- delete {_dropoptions::*}
- delete {_customdropname}
- delete {_dropchance}
- delete {_mincount}
- delete {_maxcount}
- delete {_raredrop}
- delete {_dropitem}
- #BossBar
- every tick:
- loop {bossbar::*}:
- getLivingEntityFromUUID(loop-index) is not set
- deleteBossBar("{bossbar::%loop-index%}")
- loop all entities:
- loop-entity is a living entity
- loop-entity is not a player
- set {_tags::*} to getTagValues(loop-entity)
- loop {_tags::*}:
- set {_bossbaroptions::*} to loop-value-2 split by ";"
- loop {_bossbaroptions::*}:
- if removePrefix(loop-value-3, "BarColor:") is set:
- set {_barcolor} to removePrefix(loop-value-3, "BarColor:")
- if removePrefix(loop-value-3, "BarStyle:") is set:
- set {_barstyle} to removePrefix(loop-value-3, "BarStyle:")
- if removePrefix(loop-value-3, "BarRange:") is set:
- set {_barrange} to removePrefix(loop-value-3, "BarRange:") parsed as number
- {_barcolor} is set
- {_barstyle} is set
- {_barrange} is set
- if {bossbar::%UUID of loop-entity%} is not set:
- set {bossbar::%UUID of loop-entity%} to new bossbar
- set color of bar {bossbar::%UUID of loop-entity%} to PINK
- set style of bar {bossbar::%UUID of loop-entity%} to SOLID
- evaluate "set color of bar {bossbar::%UUID of loop-entity%} to %{_barcolor} in upper case%"
- evaluate "set style of bar {bossbar::%UUID of loop-entity%} to %{_barstyle} in upper case%"
- if name of loop-entity is set:
- set name of bar {bossbar::%UUID of loop-entity%} to name of loop-entity
- else:
- set name of bar {bossbar::%UUID of loop-entity%} to getMobTypeName(loop-entity)
- set progress of bar {bossbar::%UUID of loop-entity%} to health of loop-entity/max health of loop-entity
- loop all players:
- if distance between loop-entity-1 and loop-player-1 <= {_barrange}:
- add loop-player-1 to bar {bossbar::%UUID of loop-entity-1%}
- if distance between loop-entity-1 and loop-player-1 > {_barrange}:
- remove loop-player-1 from bar {bossbar::%UUID of loop-entity-1%}
- delete {_bossbaroptions::*}
- delete {_barcolor}
- delete {_barstyle}
- delete {_barrange}
Advertisement
Add Comment
Please, Sign In to add comment