Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # titleAPI by Bryce/vexio
- # Resource Page: https://forums.skunity.com/resources/206/
- options:
- debug: false
- function title(t: text, in: number, stay: number, out: number, p: text):
- set {_t} to coloured {_t}
- set {_in} to {_in} * 20
- set {_stay} to {_stay} * 20
- set {_out} to {_out} * 20
- if {_p} = "*" or "@a":
- loop all players:
- if "%minecraft version%" contains "1.8":
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% title {text:""%{_t}%""}"
- else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% title {""text"":""%{_t}%""}"
- else:
- if "%minecraft version%" contains "1.8":
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% title {text:""%{_t}%""}"
- else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% title {""text"":""%{_t}%""}"
- {@debug} = true:
- send "&8&o[TitleAPI] &7&o(Sent &7`title` &7&ofunction to &7%{_p}%&7&o)" to all ops
- function subtitle(t: text, in: number, stay: number, out: number, p: text):
- set {_t} to coloured {_t}
- set {_in} to {_in} * 20
- set {_stay} to {_stay} * 20
- set {_out} to {_out} * 20
- if {_p} = "*" or "@a":
- loop all players:
- if "%minecraft version%" contains "1.8":
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% subtitle {text:""%{_t}%""}"
- else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% subtitle {""text"":""%{_t}%""}"
- else:
- if "%minecraft version%" contains "1.8":
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% subtitle {text:""%{_t}%""}"
- else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% subtitle {""text"":""%{_t}%""}"
- {@debug} = true:
- send "&8&o[TitleAPI] &7&o(Sent &7`subtitle` &7&ofunction to &7%{_p}%&7&o)" to all ops
- function simpleTitle(t: text, in: number, stay: number, out: number, p: text):
- set {_t} to coloured {_t}
- set {_in} to {_in} * 20
- set {_stay} to {_stay} * 20
- set {_out} to {_out} * 20
- set {_titles::*} to {_t} split at "||"
- if {_p} = "*" or "@a":
- loop all players:
- if "%minecraft version%" contains "1.8":
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% title {text:""%{_titles::1}%""}"
- console command "/title %loop-player% subtitle {text:""%{_titles::2}%""}"
- else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% title {""text"":""%{_titles::1}%""}"
- console command "/title %loop-player% subtitle {""text"":""%{_titles::2}%""}"
- else:
- if "%minecraft version%" contains "1.8":
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% title {text:""%{_titles::1}%""}"
- console command "/title %{_p}% subtitle {text:""%{_titles::2}%""}"
- else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% title {""text"":""%{_titles::1}%""}"
- console command "/title %{_p}% subtitle {""text"":""%{_titles::2}%""}"
- {@debug} = true:
- send "&8&o[TitleAPI] &7&o(Sent &7`simpleTitle` &7&ofunction to &7%{_p}%&7&o)" to all ops
- function actionBar(t: text, in: number, stay: number, out: number, p: text):
- set {_t} to coloured {_t}
- set {_in} to {_in} * 20
- set {_stay} to {_stay} * 20
- set {_out} to {_out} * 20
- if "%minecraft version%" contains "1.12":
- if {_p} = "*" or "@a":
- loop all players:
- console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %loop-player% actionbar {""text"":""%{_t}%""}"
- else:
- console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
- console command "/title %{_p}% actionbar {""text"":""%{_t}%""}"
- {@debug} = true:
- send "&8&o[TitleAPI] &7&o(Sent &7`actionBar` &7&ofunction to &7%{_p}%&7&o)" to all ops
- else:
- send "&4[ERROR]&c The function `actionBar` is not supported in any versions below 1.12" to all ops
- #! COMMANDS
- #For the lazy bums out there
- command /sendTitle [<text>] [<integer>] [<integer>] [<integer>] [<text>]:
- permission: command.sendTitle
- permission message: &cInvalid permission.
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- if arg 3 is set:
- if arg 4 is set:
- if arg 5 is set:
- #send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- simpleTitle("%arg-5%", arg-2, arg-3, arg-4, "%arg-1%")
- else:
- send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- command /sendActionbar [<text>] [<integer>] [<integer>] [<integer>] [<text>]:
- permission: command.sendActionbar
- permission message: &cInvalid permission.
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- if arg 3 is set:
- if arg 4 is set:
- if arg 5 is set:
- #send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- actionBar("%arg-5%", arg-2, arg-3, arg-4, "%arg-1%")
- else:
- send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
- else:
- send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
Advertisement
Add Comment
Please, Sign In to add comment