Snippets on skUnity

Rotations (for 1.19.4)

Posted by: hashed_ice Requires: skript-reflect
import: java.util.Arrays java.util.stream.Collectors net.minecraft.network.protocol.game.PacketPlayOutPosition net.minecraft.world.entity.RelativeMovement on script load: set {_TPFlags} to RelativeMovement set {_flags::*} to ({_TPFlags}.d), ({_TPFlags}.b), ({_TPFlags}.a), ({_TPFlags}.c) and ({_TPFlags}.e) set {_flagArray} to [{_flags::*} as {_TPFlags}] set {crackshot::teleportation::set} to Arrays.stream({_flagArray}).collect(Collectors.toSet()) effect rotate %player% by %number% horizontally and %number% vertically: trigger: set {_p} to expression 1 set {_bool} to {_p}.isOnGround() set {_yaw} to expression 2 * 256 / 360 set {_pitch} to expression 3 * 256 / 360 set {_args::*} to 0.0, 0.0, 0.0, {_yaw}, {_pitch}, {crackshot::teleportation::set} and 0 set {_packet} to new PacketPlayOutPosition({_args::*}) expression 1.getHandle().b.a({_packet})

Rotate player's head vertically and horizontally by packets (PacketPlayOutPosition)
For 1.17 go find my older version

Gui formatter

Posted by: thelividx
function getGuiIndices(x1: integer, y1: integer, x2: integer, y2: integer) :: integers: loop integers from ({_y1}) to ({_y2}): add integers from ({_x1} + (loop-value* 9)) to ({_x2} + (loop-value* 9)) to {_l::*} return {_l::*}

input coordinates of a range and return gui slots

Formatting a number with fixed amount of decimals

Posted by: tenfont
function formatDecimals(n: number, decimals: number) :: string: # Removing the decimal point and reserving last {_decimals} digits for the decimals. # e.g. {_n} = 1.5, {_decimals} = 2 would give us 150, last 2 digits are reserved for the decimals (this is essentially 1.50 without the decimal point) # Change 'round' to 'floor' if you wish to floor the number instead. set {_n} to "%round({_n} * (10 ^ {_decimals}))%" # Prepend zeroes to the beginning of our new number. # Skript omits zeros from the beginning of our number as they are insignificant, so this code is adding them back. # This assures that at the end of all the steps, we will end up with at LEAST 1 digit before the decimal point. # If this step is skipped, then a number such as `0.5` might be formatted as `<none>.5` instead. set {_prependZeros} to max(0, ({_decimals} + 1 - length of {_n})) if {_prependZeros} > 0: set {_n} to "%"0" repeated {_prependZeros} times%%{_n}%" # We have reserved the last {_decimals} digits for the decimals. # So this part splits up the number such that one variable contains the decimals (the reserved portion i.e. the fixed amount of digits at the end) # The other variable contains the rest of the number set {_beforeDecimal} to formatNumber(first ((length of {_n}) - {_decimals}) characters of {_n}) set {_afterDecimal} to last {_decimals} characters of {_n} # Return the two parts joined by a decimal point. return join {_beforeDecimal} and {_afterDecimal} by "." # Formats the number with commas. 1000 -> 1,000 function formatNumber(num: text) :: text: if length of {_num} > 3: return "%formatNumber(first length of {_num} - 3 characters of {_num})%,%last 3 characters of {_num}%" return {_num}

This snippet allows you to format any number with commas, as well as a fixed amount of decimals.
e.g. formatNumber(1, 3) would give you 1.000, even though the digits following the decimal point are insignificant.
Can be used for printing currencies

Cast a MythicMobs Skill with skript-reflect

Posted by: luvis__ Requires: skript-reflect
import: io.lumine.mythic.bukkit.BukkitAPIHelper function CastMythicSkill(e: Entity, Skill: String): new BukkitAPIHelper().castSkill({_e}, {_skill})

Cast a MythicMobs Skill with skript-reflect

Manage WorldGuard regions with skript-reflect

Posted by: luvis__ Requires: skript-reflect
import: org.bukkit.Location com.sk89q.worldedit.math.BlockVector3 com.sk89q.worldedit.bukkit.BukkitAdapter com.sk89q.worldguard.WorldGuard com.sk89q.worldguard.protection.managers.RemovalStrategy com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion function GetCurrentArea(l: Location) :: String: set {_region} to WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().getApplicableRegions(BukkitAdapter.adapt({_l})).toString() return {_region} function AddArea(name: String, l1: Location, l2: Location): set {_x1} to {_l1}.getBlockX() set {_y1} to {_l1}.getBlockY() set {_z1} to {_l1}.getBlockZ() set {_x2} to {_l2}.getBlockX() set {_y2} to {_l2}.getBlockY() set {_z2} to {_l2}.getBlockZ() set {_min} to BlockVector3.at({_x1}, {_y1}, {_z1}) set {_max} to BlockVector3.at({_x2}, {_y2}, {_z2}) set {_area} to new ProtectedCuboidRegion({_name}, {_min}, {_max}) WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt({_l1}.getWorld())).addRegion({_area}) WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt({_l1}.getWorld())).saveChanges() function RemoveArea(name: String, w: World): WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt({_w})).removeRegion({_name}, RemovalStrategy.REMOVE_CHILDREN) WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt({_w})).saveChanges()

Manage WorldGuard regions with skript-reflect

Add or Remove Permission with skript-reflect and Luckperms

Posted by: luvis__ Requires: skript-reflect
import: net.luckperms.api.LuckPermsProvider net.luckperms.api.model.user.User net.luckperms.api.node.Node function AddPermission(p: Player, permission: String): LuckPermsProvider.get().getUserManager().getUser({_p}.getUniqueId()).data().add(Node.builder({_permission}).build()) LuckPermsProvider.get().getUserManager().saveUser(LuckPermsProvider.get().getUserManager().getUser({_p}.getUniqueId())) function RemovePermission(p: Player, permission: String): LuckPermsProvider.get().getUserManager().getUser({_p}.getUniqueId()).data().remove(Node.builder({_permission}).build()) LuckPermsProvider.get().getUserManager().saveUser(LuckPermsProvider.get().getUserManager().getUser({_p}.getUniqueId()))

Add or Remove Permission with skript-reflect and Luckperms

Save or Read Yml File with skript-reflect

Posted by: luvis__ Requires: skript-reflect
import: java.io.File org.bukkit.Bukkit org.bukkit.configuration.file.YamlConfiguration function FileExists(path: String) :: boolean: set {_file} to new File({_path}) return {_file}.exists() function SetYaml(path: String, key: String, value: Object): set {_file} to new File({_path}) set {_yaml} to YamlConfiguration.loadConfiguration({_file}) {_yaml}.set({_key}, {_value}) {_yaml}.save({_file}) function SetYamlList(path: String, key: String, value: Objects): set {_file} to new File({_path}) set {_yaml} to YamlConfiguration.loadConfiguration({_file}) {_yaml}.set({_key}, {_value}) {_yaml}.save({_file}) function ReadYaml(path: String, key: String) :: String: set {_file} to new File({_path}) set {_yaml} to YamlConfiguration.loadConfiguration({_file}) return {_yaml}.getString({_key}) function ReadYamlList(path: String, key: String) :: Objects: set {_file} to new File({_path}) set {_yaml} to YamlConfiguration.loadConfiguration({_file}) return {_yaml}.getList({_key})

Save or Read Yml File with skript-reflect

Change type of item

Posted by: erenkarakal Requires: SkBee
function changeItemType(item: item, target: itemtype) :: item: set {_nbt} to full nbt of {_item} set {_namespace} to namespaced key of {_target} set tag "id" of {_nbt} to {_namespace} return item from nbt {_nbt}

A function for changing the type of an item, because apparently it is not possible.

Number -> Suffix

Posted by: sirsmurfy2
options: decimalPlaces: 2 on load: set {-Suffixes::*} to "K","M","B","T","Qd","Qn" function convertNumber(n: number) :: text: if {_n} >= 1000: loop {-Suffixes::*}: if ( {_n} / (1000^(loop-index parsed as number) ) ) < 1000: set {_new} to floor( ( {_n} / (1000^(loop-index parsed as number) ) ) * ( 10^{@decimalPlaces} ) ) / ( 10^{@decimalPlaces} ) return "%{_new}%%loop-value%" else: return "%{_n}%" # replace "loop-index parsed as number" to "loop-iteration" if using Skript 2.8+

Allows you to convert numbers to a shortened number with corresponding suffix. All that you have to do is add a new suffix to the list and it will take care of the rest.

Number -> Price Converter

Posted by: cheezburga Requires: skript-reflect
import: java.lang.String java.lang.Long function formatNumber(i: number) :: string: if mod({_i}, 1) is 0: return String.format("%%,d", new Long({_i})) else: return String.format("%%,.2f", {_i})

Takes any number and converts it to an easy-to-read price (e.g. 100400.23 -

100,400.23).

Set Client Tickrate

Posted by: cerial_ Requires: skript-reflect
#! Client Tick Changer #! Made by Cerial #! DEPENDENCIES #! - Skript 2.7.3 or above #! - ProtocolLib (the latest for your Minecraft version) #! - skript-reflect import: com.comphenix.protocol.events.PacketContainer com.comphenix.protocol.PacketType com.comphenix.protocol.ProtocolLibrary function TickChanger_changeTickOfPlayer(p: player, tps: number, frozen: boolean=false): set {_packet} to new PacketContainer(PacketType.Play.Server.TICKING_STATE) {_packet}.getFloat().write(0, {_tps}) {_packet}.getBooleans().write(1, {_frozen}) try ProtocolLibrary.getProtocolManager().sendServerPacket({_p}, {_packet}) set {_ex} to last exception {_ex} is set broadcast "&cFailed to send TickChanger packet: %{_ex}%"~

This snippet allows you to set a player's tickrate (a 1.20.3+ feature) without changing the server TPS.
To change the TPS, use the TickChanger_changeTickOfPlayer function, and pass in a player and the TPS.

Reset player's attribute

Posted by: o_stein
function resetAttributes(player: player): set {_player}'s attack speed attribute to 4 set {_player}'s luck attribute to 0 set {_player}'s attack damage attribute to 1 set {_player}'s armor attribute to 0 set {_player}'s knockback resistance attribute to 0.5 set {_player}'s max health attribute to 20 set {_player}'s armor toughness attribute to 0 set {_player}'s movement speed attribute to 0.1

Resets a player's attributes

String -> Number Converter

Posted by: cheezburga Requires: skript-reflect
on load: set {format::multiplier::k} to 1000 set {format::multiplier::m} to 1000000 set {format::multiplier::b} to 1000000000 function formatNumberFromString(num: string) :: number: if {_num} matches "^\d*\.?\d*[kmb]?$": return ({_num} parsed as number) if ({_num} parsed as number) is set set {_number} to {_num}.replaceAll("[a-zA-Z]", "") parsed as number set {_letter} to {_num}.replaceAll("[^a-zA-Z]", "") return ({_number} * {format::multiplier::%{_letter}%}) return -1

Accepts any valid string and returns the appropriate number. Allows "k", "m", and "b" as part of the string. For example "1.5k" -

1500.

Change NPC skin

Posted by: budgo. Requires: skript-reflect
import: org.bukkit.plugin.java.JavaPlugin net.citizensnpcs.Citizens net.citizensnpcs.trait.SkinTrait function setSkin(targetEntity: entity, skinName: text): set {_registry} to JavaPlugin.getPlugin(Citizens.class).getNPCRegistry() set {_npc} to {_registry}.getNPC({_targetEntity}) set {_trait} to {_npc}.getOrAddTrait(SkinTrait.class) {_trait}.setSkinName({_skinName}, true)

Allows you to change the skin of an npc, given the entity and the name of the player wearing the desired skin (as a text)

ItemType to ItemStack

Posted by: fusezion Requires: skript-reflect
function getItems(itemtypes:itemtypes) :: items: loop {_itemTypes::*}: if loop-value.isAll() is false: add loop-value to {_items::*} else: set {_iterator} to loop-value.getAll().iterator() while {_iterator}.hasNext() is true: add {_iterator}.next() to {_items::*} return {_items::*}

We all suffer from Skript's itemtype being overly bad when used in functions i.e. you need to store every possible itemstack an itemtype supports into an array. Only just to be told back 1 itemstack or just returning the itemtype. Well look no further this annoying yet easy to use snippet is just for you. Requires Reflect

String to Timespan (fixed)

Posted by: slyme.the.slime
on load: set {-time::s} to "second" set {-time::m} to "minute" set {-time::h} to "hour" set {-time::d} to "day" set {-time::w} to "week" set {-time::mo} to "month" set {-time::y} to "year" function stringToTimespan(input: string) :: timespan: replace all " " in {_input} with "" set {_vals::*} to regex split {_input} at "\D+" delete {_vals::%the last element of {_vals::*}'s indexes%} set {_vals::*} to split (join {_vals::*} with " ") at " " set {_tokens::*} to regex split {_input} at "\d+" delete {_tokens::1} set {_tokens::*} to split (join {_tokens::*} with " ") at " " loop {_vals::*}: set {_longToken} to {_tokens::%loop-index%} if {-time::%{_tokens::%loop-index%}%} exists: set {_longToken} to {-time::%{_tokens::%loop-index%}%} add "%loop-value% %{_longToken}% " to {_result::*} set {_result} to (join {_result::*} with "") send {_result} to console return {_result} parsed as timespan

Adaptation of String to Timespan by erenkarakal. The original didn't work with double-digits, so I fixed it by rewriting its code.
Converts timespan shortcuts to an actual timespan
ex.
1d2y3w = 752 days
1 week 123m3d = 10 days and 2.05 hours

Hex To Decimal; Hex Color to RGB Color

Posted by: brian9171
# Returns a string of the hex value of the input # Made by Sovde, Modified by Brian9171 function decimal_to_hex(number: number, digit-count: integer = -1) :: string: while {_number} > 0: add 1 to {_count} set {_result} to join (character at (mod({_number}, 16) + 1) in "0123456789ABCDEF") and {_result} set {_number} to floor({_number} / 16) if {_result} is set: if {_digit-count} != -1: set {_zeroes} to {_digit-count} - {_count} loop {_zeroes} times: set {_result} to "0%{_result}%" return {_result} ? "0" # Returns a number of the decimal value of the input, as a positive integer # Made by Sovde function hex_to_decimal(hex: text) :: number: loop reversed (split uppercase {_hex} at ""): set {_result} to {_result} + (first index of loop-value in "0123456789ABCDEF" - 1) * 16 ^ ({_i} - 1) add 1 to {_i} return {_result} # Returns a list of numbers representing an RGB color # Made by Brian9171 function color_hex_to_rgb(hex: string) :: numbers: return hex_to_decimal(first 2 characters of {_hex}), hex_to_decimal(subtext of {_hex} from 3 to 4) and hex_to_decimal(last 2 characters of {_hex}) # Returns a hex string from a list of numbers representing an RGB color # Made by Brian9171 function color_rgb_to_hex(rgb: numbers) :: string: return "%decimal_to_hex({_rgb::1}, 2)%%decimal_to_hex({_rgb::2}, 2)%%decimal_to_hex({_rgb::3}, 2)%"

Hex To Decimal and Decimal to Hex functions, and Hex Color to RGB Color function and RGB Color to Hex Color functions.

Teleport entity with passengers

Posted by: boxic Requires: skript-reflect
import: io.papermc.paper.entity.TeleportFlag$EntityState # Later in your code {_entity}.teleport({_location}, EntityState.RETAIN_PASSENGERS)

This requires Skript-Reflect, and it's tested on paper 1.20.2, results may vary for earlier versions

Removal of unused Variables in a Variablelist

Posted by: shorty02of
function removeIfNotExisting(t: text): replace all "{" and "}" and "::*" with "" in {_t} if "%{_t}%" contains "::": if indices of {%{_t}%::*} is not set: delete {_split::*} set {_split::*} to "%{_t}%" split at "::" delete {_split::%size of {_split::*}%} set {_newt} to join {_split::*} by "::" delete {%{_newt}%::*} removeIfNotExisting("%{_newt}%") on load: delete {test::*} set {test::test::test::test} to true set {_all} to "test::test" loop indices of {test::test::*}: loop {test::test::%loop-value-1%::*}: broadcast "&a%loop-value-2%" delete {test::test::test::*} removeIfNotExisting("{test::test::test::*}") loop indices of {test::*}: broadcast "&1%loop-value-1%" loop {test::test::%loop-value-1%::*}: broadcast "&2%loop-value-2%"

It removes all indices of a list if the last (-

{indice1::indice2::...::indice10}) is not set

Format numbers with zeros in front

Posted by: giuca002
function formatNumber(num: text, amount: number) :: text: broadcast ({_amount} - length of "%{_num}%") if ({_amount} - length of "%{_num}%") is less than 1: stop loop ({_amount} - length of "%{_num}%") times: set {_num} to "0%{_num}%" return {_num}

This basic function aids with putting strings or numbers (parsed as text) into the correct format for Unicode. For example: "1" -

"0001" if the second parameter is set to 4. This will ensure there's always 4 characters.

Streamlined Decimal <-> Hexadecimal Conversion

Posted by: sovde
# valid inputs are positive integers. 0 is returned if the input is negative. Decimal inputs are rounded down. # returns a string of the hex value of the input function decimalToHex(number: number) :: string: while {_number} > 0: set {_result} to join (character at (mod({_number}, 16) + 1) in "0123456789ABCDEF"), {_result} set {_number} to floor({_number} / 16) return {_result} ? "0" # valid inputs are strings of hex digits (0-9, A-F). Any other input will result in an undefined output. # you can add `matches "[0-9a-fA-F]+"` as a condition to ensure the input is valid if you want. # returns a number of the decimal value of the input, as a positive integer function hexToDecimal(hex: text) :: number: loop reversed (split uppercase {_hex} at ""): set {_result} to {_result} + (first index of loop-value in "0123456789ABCDEF" - 1) * 16 ^ ({_i} - 1) add 1 to {_i} return {_result}

Functions for easily converting between hex strings and decimal numbers (sorry other snippet)

Centered GUI Slots

Posted by: cheezburga
function getSlotIndexes(size: int) :: ints: return {_none} if {_size} is not between 1 and 54 set {_lines} to floor({_size} / 9) if {_lines} > 0: loop integers between 0 and ({_lines} - 1): loop integers between 0 and 8: add ((loop-value-1 * 9) + loop-value-2) to {_slots::*} set {_rem} to mod({_size}, 9) if {_rem} > 0: set {_start} to (4 - floor({_rem} / 2)) if mod({_rem}, 2) is 0: loop integers between 0 and ({_rem} - 1): if loop-value is floor({_rem} / 2): add 1 to {_start} add (({_lines} * 9) + {_start} + loop-value) to {_slots::*} else: loop integers between {_start} and ({_start} + {_rem} - 1): add (({_lines} * 9) + loop-value) to {_slots::*} return {_slots::*} command /example: # uses skript-gui trigger: set {_items::*} to (diamond, stick, diamond, stick, oak wood planks, diamond sword, diamond pickaxe, gold boots, gold chestplate, gold leggings, gold helmet) set {_slots::*} to getSlotIndexes(size of {_items::*}) create gui with virtual chest inventory with ceil(size of {_slots::*} / 9) rows named "Example": loop indexes of {_slots::*}: format gui slot {_slots::%loop-value%} with {_items::%loop-value%} loop (54 - (size of {_slots::*})) times: format next gui slot with black stained glass pane open last gui to player

Provides a function which, when given a valid size (between 1 and 54 i.e. the number of slots in a GUI), will return the indexes of the slots so that you can easily have centered items.

IRL Time Event - Vanilla Skript

Posted by: sovde
options: # UTC-Offset is the number of hours your timezone is offset from UTC # For example, if you're in UTC-8, you would put -8 here UTC-Offset: -8 # find the number of seconds until a given time # Uses 24 hour time function findSecondsUntil(hour: number, minutes: number = 0, seconds: number = 0) :: number: set {_unix-now} to unix timestamp of now # Offset to correct for timezone add 3600 * {@UTC-Offset} to {_unix-now} # offset by the hour, minutes, and seconds to get the exact time we're looking for add -3600 * {_hour} to {_unix-now} add -60 * {_minutes} to {_unix-now} add -1 * {_seconds} to {_unix-now} # use modulus to find the number of seconds until the time we're looking for return 86400 - mod({_unix-now}, 86400) # This event will regularly check if it's time to run the irl events # You can change the interval to whatever you want, but make sure to adjust the if statements accordingly # I recommend leaving it at 10 minutes every 10 minutes: # every day at 8:00 # since we check every 10 minutes, if we're within 10 minutes of 8:00, we should wait and trigger at 8:00 exactly set {_seconds} to findSecondsUntil(8) if {_seconds} < 600: wait "%{_seconds}% seconds" parsed as timespan runAt8() # every day at 20:00 # technically this could be delayed by up to 10 minutes, but since 20:00 is 12 hours after 8:00, it doesn't matter # just be aware that this behavior exists set {_seconds} to findSecondsUntil(20) if {_seconds} < 600: wait "%{_seconds}% seconds" parsed as timespan runAt20() function runAt8(): broadcast "It's 8:00!" function runAt20(): broadcast "It's 20:00!"

Provides a pseudo-event that runs at a set time each day

Send text from unicode

Posted by: cerial_ Requires: skript-reflect
#! Get character from unicode string #! Example: \uXXXX, this also supports multiple unicode characters #! APACHE COMMONS REQUIRED, DOWNLOAD HERE -> https://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar import: org.apache.commons.lang3.StringEscapeUtils function stringFromUnicode(s: string) :: string: return StringEscapeUtils.unescapeJava({_s})

It returns a string from unicode. For example, \u9991 returns .

Roman Numeral <-> Integer

Posted by: cheezburga Requires: skript-reflect
on load: set {-roman::numerals::*} to ("M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I") set {-roman::values::*} to (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1) expression roman [numeral] (of|from) %integers%: get: loop exprs-1: clear {_numeral::*} set {_i} to loop-value loop (size of {-roman::values::*}) times: while {_i} >= {-roman::values::%loop-value-2%}: subtract {-roman::values::%loop-value-2%} from {_i} add {-roman::numerals::%loop-value-2%} to {_numeral::*} add (join {_numeral::*} using "") to {_return::*} return {_return::*} expression [arabic] number (of|from) %strings%: get: loop exprs-1: delete {_result} set {_r} to (loop-value in upper case) if {_r} matches "^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$": set {_r::*} to ({_r} split at "") loop reversed (size of {_r::*}) times: delete {_value} set {_char} to {_r::%loop-value-2%} loop (size of {-roman::numerals::*}) times: if {-roman::numerals::%loop-value-3%} is {_char}: set {_value} to {-roman::values::%loop-value-3%} exit loop if {_value} < {_prev}: subtract {_value} from {_result} else: add {_value} to {_result} set {_prev} to {_value} add {_result} to {_return::*} continue add (-1) to {_return::*} return {_return::*}

Adds two simple expressions which allow for integers to be converted to Roman numerals, and for Roman numerals to be converted to integers.

number format

Posted by: m.y3806
function digits(n: number) :: string: return join (regex split "%{_n}%" by "(?<=\d)(?=(\d\d\d)+(?!\d))") by ","

example: 100000 -

100,000

String to Timespan

Posted by: erenkarakal
on load: set {-time::s} to "second" set {-time::m} to "minute" set {-time::h} to "hour" set {-time::d} to "day" set {-time::w} to "week" set {-time::mo} to "month" set {-time::y} to "year" function stringToTimespan(input: string) :: timespan: replace all " " in {_input} with "" loop regex {_input} split at "(?=\d)": set {_t::*} to regex loop-value split at "(?<=\d)(?=[a-z])" set {_t::2} to " %{-time::%{_t::2}%} ? {_t::2}% " add (join {_t::*} with "") to {_result::*} set {_result} to (join {_result::*} with "") return {_result} parsed as timespan

Converts timespan shortcuts to an actual timespan
ex.
1d2y3w = 752 days
1 year 3w 2h = 386 days and 2 hours

Custom Toast (Advancement) Messages

Posted by: righthandman. Requires: skript-reflect
import: ch.njol.skript.Skript org.bukkit.Bukkit org.bukkit.NamespacedKey com.google.gson.GsonBuilder com.google.gson.JsonObject effect send [a] [custom] (toast|achievement|advancement) with [title] %string% and [icon] %string% to %players%: trigger: set {_id} to new NamespacedKey(Skript.getInstance(), a random uuid) set {_json} to new JsonObject() set {_iconJson} to new JsonObject() {_iconJson}.addProperty("item", expr-2) set {_display} to new JsonObject() {_display}.add("icon", {_iconJson}) {_display}.addProperty("title", expr-1) {_display}.addProperty("description", "N/A") {_display}.addProperty("background", "minecraft:textures/gui/advancements/backgrounds/adventure.png") {_display}.addProperty("frame", "goal") {_display}.addProperty("announce_to_chat", false) {_display}.addProperty("show_toast", true) {_display}.addProperty("hidden", true) set {_criteria} to new JsonObject() set {_trigger} to new JsonObject() {_trigger}.addProperty("trigger", "minecraft:impossible") {_criteria}.add("impossible", {_trigger}) {_json}.add("criteria", {_criteria}) {_json}.add("display", {_display}) set {_gson} to new GsonBuilder().setPrettyPrinting().create() Bukkit.getUnsafe().loadAdvancement({_id}, {_gson}.toJson({_json})) set {_advancement} to Bukkit.getAdvancement({_id}) loop exprs-3: set {_progress} to loop-value.getAdvancementProgress({_advancement}) loop ...{_progress}.getRemainingCriteria(): {_progress}.awardCriteria(loop-value-2) wait 10 ticks loop exprs-3: set {_progress} to loop-value.getAdvancementProgress({_advancement}) loop ...{_progress}.getAwardedCriteria(): {_progress}.revokeCriteria(loop-value-2)

A single simple effect which sends a custom goal toast to multiple players

Timespan Format Shortener v2

Posted by: edu1504
function time_format(time: timespan) :: string: set {_time} to "%{_time}%" set {_timespan::*} to {_time} parsed as "%number% %string%[s][ and %number% %string%[s]]" set {_first} to "%{_timespan::1}%%first character of {_timespan::2}%" set {_second} to "%{_timespan::3}%%first character of {_timespan::4}%" return ("%{_first}% %{_second}%" if {_timespan::3} is set, else "%{_first}%")

This one just uses Skript and instead of complex logic, abuses of the parse expression in order to achieve better results, since as you can see in https://discord.com/channels/135877399391764480/1156628848507637803 the previous version had errors and it required skript-reflect as well so I just decided to go the simple way about it.

Another Timespan Format Shortener

Posted by: edu1504 Requires: skript-reflect
on script load: clear {-time::*} set {-time::d} to 1000 * 60 * 60 * 24 set {-time::h} to 1000 * 60 * 60 set {-time::m} to 1000 * 60 set {-time::s} to 1000 function time_format(input: timespan) :: string: set {_millis} to {_input}.getMilliSeconds() return toString({_millis}) function toString(millis: number) :: string: set {_time-index::*} to indices of {-time::*} loop {-time::*}: add 1 to {_count} set {_previous} to {-time::%{_time-index::%{_count} - 1%}%} set {_next} to {-time::%{_time-index::%{_count} + 1%}%} if {_millis} >= loop-value: set {_second} to mod({_millis}, loop-value) / {_next} if {_second} isn't 0: # bad style but who cares... set {_first} to withAmount(floor({_millis} / loop-value), loop-index) set {_third} to withAmount({_second}, {_time-index::%{_count} + 1%}) return "%{_first}% %{_third}%" else: return withAmount(({_millis} / loop-value), loop-index) set {_last} to last element out of {-time::*} return withAmount(({_millis} / {_last}), last element out of {_time-index::*}) function withAmount(amount: number, p: string) :: string: return "%{_amount}%%{_p}%"

It's a timespan shortener like the last one but this one is mostly what Skript does when parsing timespans to strings too if you look at the Java impl. It converts decimals properly as well, like 20.32 minutes gets converted to 20m 19.2s

**Timespan Format Shortener**

Posted by: drcausa Requires: skript-reflect
import: java.lang.String function time_format(input:timespan) :: string: return "∞" if ({_input} isn't set) set {_values::*} to (floor({_input}'s seconds / 86400), floor(mod({_input}'s hours, 24)), floor(mod({_input}'s minutes, 60)), floor(mod({_input}'s seconds, 60)), String.format("%%02d", floor({_input}'s ticks * 5))) return (String.format("%%02dd %%02dh %%02dm %%02d.%{_values::5}.charAt(({_values::5}'s length) - 2)%s", {_values::1}, {_values::2}, {_values::3}, {_values::4})).replaceAll("(00(d|h|m) | 00.0s)", "")

A simple timespan format shortener that will return the days, hours, minutes, seconds, and milliseconds of a timespan with the format d h m s.ms.
example of what the output would look like: <https://postimg.cc/VrFnWXdm>

Insert Into List Function

Posted by: ethanovich
# Usage: insert({mylist::*}, "This will be Line 4 of {mylist::*}", 4) # WARNING: Returns a list with index numbers ({return::1}, {return::2}, etc) function insert(list: strings, insert: string, line: integer) :: strings: if size of {_list::*} >= {_line}: set {_num} to size of {_list::*} loop reversed {_list::*}: if {_num} >= {_line}: set {_list::%{_num} + 1%} to loop-value if {_num} = {_line}: set {_list::%{_num}%} to {_insert} set {_num} to {_num} - 1 return {_list::*} # Haven't tested or worked on this extensively, so code might be bad idk

Takes a list, a given string, and a line number, and inserts the string at the line number while saving the original line.

Armor Changed By Player

Posted by: ethanovich Requires: SkBee
on armor change: # Check if either of the items is air, no need to run this check if the item is air. if new armor item isn't air: if old armor item isn't air: # Requires the '? "ITEM-NO-NAME"' because of weird comparisons between items without names and items with names. # If I were to get rid of the '?' sections, it wouldn't stop event if old item wasn't named/lored, and new armor is named/lored. set {_old} to type of (old armor item) named (name of old armor item) with lore (lore of old armor item) set {_new} to type of (new armor item) named (name of new armor item) with lore (lore of new armor item) stop if ({_old} = {_new}) send "Event Fires" # For debug/testing purposes

Changes functionality of armor change event so it only fires if the player changes armor. (Won't fire if the item's durability changes)

Set world edit selection point for player

Posted by: envizar Requires: skript-reflect
import: org.bukkit.Bukkit com.sk89q.worldedit.LocalSession com.sk89q.worldedit.bukkit.BukkitAdapter com.sk89q.worldedit.math.BlockVector3 com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits com.sk89q.worldedit.extension.platform.Actor function setSelectionPos(pos: number, p: player, loc: location): set {_worldedit} to Bukkit.getServer().getPluginManager().getPlugin("WorldEdit") set {_session} to {_worldedit}.getSession({_p}) set {_loc} to exact location of block at {_loc} set {_bv} to BlockVector3.at({_loc}.getX(), {_loc}.getY(), {_loc}.getZ()) set {_adapted::1} to (BukkitAdapter.adapt({_p})) set {_proxy} to new proxy instance of Actor using {_adapted::*} set {_rgsel} to {_session}.getRegionSelector(BukkitAdapter.adapt(world "world")) if {_pos} is 1: {_rgsel}.selectPrimary({_bv}, ActorSelectorLimits.forActor({_proxy})) else: {_rgsel}.selectSecondary({_bv}, ActorSelectorLimits.forActor({_proxy}))

Sets world edit selection point of player usint skript-reflect

**Simple Countdown System**

Posted by: drcausa Requires: skript-reflect
import: java.lang.String function countdown(input:timespan) :: string: set {_d} to floor({_input}'s seconds / 86400) set {_h} to floor(mod({_input}'s hours, 24)) set {_m} to floor(mod({_input}'s minutes, 60)) set {_s} to floor(mod({_input}'s seconds, 60)) return String.format("%%02d:%%02d:%%02d:%%02d", {_d}, {_h}, {_m}, {_s}) # Small example of how it would be used: on join: set {time} to 2 days from now while player is online: send action bar "Time left: &b%countdown(difference between {time} and now)%" to player wait 0.1 second

A simple 'countdown' system that will return the difference between two timespans formatted like this: dd:hh:mm:ss

Memory Percentage

Posted by: pf0 Requires: skript-reflect
import: java.lang.Runtime function memUsage() :: number: set {_m} to Runtime.getRuntime().maxMemory() return floor(({_m}-Runtime.getRuntime().freeMemory())/{_m}*100)

Uses Skript-reflect to get the used memory, as a percentage of the available memory

Capture Chat Inputs

Posted by: sovde
on chat: # do we need to capture this message? if metadata tag "capture-response" of sender is set: # store message and suppress it set metadata tag "response" of sender to message cancel event # tell everyone that we captured the message delete metadata tag "capture-response" of sender command /test: trigger: # make sure we aren't already waiting for a message from the player if metadata tag "capture-response" of sender is set: send "You are already responding to a question!" stop # ask the player a question send "What is your favorite color?" # say we want to capture the next message sent by the player set metadata tag "capture-response" of sender to true # wait for the player to respond while metadata tag "capture-response" of sender is set: add 1 to {_counter} # if the player doesn't respond within 10 seconds, abort mission if {_counter} is greater than 10: delete metadata tag "capture-response" of sender send "You took too long to respond!" stop wait 1 second # hey look, the player responded! # we can read the response from the "response" metadata tag send "Your favorite color is %metadata tag "response" of sender%!"

Basic example of asking a player for a response in chat and then capturing that response for later use

Quaternion from Euler Angle in Degrees

Posted by: mikoser
expression quaternion from [vector] %vector%: return type: quaternion get: set {_x} to x of expr-1 set {_y} to y of expr-1 set {_z} to z of expr-1 set {_c1} to cos({_x} / 2) set {_c2} to cos({_y} / 2) set {_c3} to cos({_z} / 2) set {_s1} to sin({_x} / 2) set {_s2} to sin({_y} / 2) set {_s3} to sin({_z} / 2) # Assuming the angle is already in XYZ format: set {_q_x} to {_s1} * {_c2} * {_c3} + {_c1} * {_s2} * {_s3} set {_q_y} to {_c1} * {_s2} * {_c3} - {_s1} * {_c2} * {_s3} set {_q_z} to {_c1} * {_c2} * {_s3} - {_s1} * {_s2} * {_c3} set {_q_w} to {_c1} * {_c2} * {_c3} + {_s1} * {_s2} * {_s3} set {_quat} to quaternion({_q_x}, {_q_y}, {_q_z}, {_q_w}) return {_quat}

This snippet requires SkBee and skript-reflect to function. What it does is it converts your input vector into a quaternion. Example: If you want to rotate a display entity by 45 degrees on the Y axis, you can use the new expression quaternion from vector(0,45,0) to do so.

NOTE: This applies rotations in YXZ order. Source of calculation comes from three.js's source code.

**Disable Anvil Enchanting**

Posted by: eyzk
on inventory click: if event-inventory = anvil inventory: if event-slot = 2: if slot 1 of event-inventory = enchanted book: cancel event

Disallows the player from enchanting with anvils. Created per request.

Gui Shaper

Posted by: xorzn Requires: SkBee
command /gui: trigger: set (metadata "gui" of player) to chest inventory with 6 row with name "GUII" set {_shape::*} to "xxxxxxxxx","x-------x","x-------x","x-------x","x-------x","xxxxxxxxx" set {_filler} to gray stained glass pane named " " guiShape((metadata "gui" of player),{_shape::*},"x",{_filler}) open (metadata "gui" of player) to player #This function could be improved i believe it. function guiShape(inv:inventory,s:strings,d:string,i:itemtype): loop {_s::*}: set {_t::*} to split loop-value at "" loop {_t::*}: set {_num} to loop-index-2 parsed as integer if loop-value-2 = "%{_d}%": set slot ({_num}+{_n}-1) of {_inv} to {_i} with all flags hidden add 9 to {_n}

Tired of having to do (integers between x and y) and having to read chest inventory slots number?, dont worry this shaper i made will help save your time! (this is my first snippet so dont booli)

Get unicode symbol from string code

Posted by: derewah Requires: skript-reflect
import: java.lang.Character as JavaCharacter java.lang.Integer as JavaInteger java.lang.String as JavaString expression (unicode|uc) [character] [(from|of) [string]] %string%: get: set {_cp} to JavaInteger.parseInt(expr-1, 16) set {_chars} to JavaCharacter.toChars({_cp}) set {_string} to "%{_chars}%" replace all "[", "]", "," in {_string} with "" return {_string}

It allows you to do

set {_symbol} to unicode "E000" for example, without having to hard-code every icon in your skript.
It will save in the variable {_symbol} the actual unicode character linked to that code.

Easy pagination from list

Posted by: fusezion
# set {-numbers::*} to integers from 10 to 150 # broadcast getPageObjects(4, 10, {-numbers::*}) function getPageObjects(page:number, elementsPerPage:number, objects:objects) :: objects: set {_page} to floor({_page})-1 set {_elementsPerPage} to floor({_elementsPerPage}) set {_start} to {_page} * {_elementsPerPage} set {_end} to {_start}+{_elementsPerPage} loop integers from {_start}+1 to {_end}: add (loop-value)th element of {_objects::*} to {_objs::*} return {_objs::*}

The easiest and safest way to paginate any list of objects into a quick and easy to use system. Whether you need it for your weird top 30 leaderboard or just a page in a gui, this snippet got you covered.

File System

Posted by: _dialed Requires: skript-reflect
import: java.io.FileWriter function file(p: player, path: string, content: objects): set {_file} to new FileWriter({_path}) loop {_content::*}: {_file}.append("%loop-value%%nl%") {_file}.close() message "&aSuccesfully saved to file!" to {_p}

Simple filing system, Takes a pathway and a list as an input
then writes each element of that list to a new line to the given file from the pathway

Spiral generator

Posted by: kajuslion
function spiral(n: number) :: numbers: set {_k} to ceil((sqrt({_n})-1)/2) set {_t} to 2*{_k}+1 set {_m} to {_t}^2 set {_t} to {_t}-1 return {_k}-({_m}-{_n}), ({_k}*-1) if {_n} >= {_m}-{_t} set {_m} to {_m}-{_t} return {_k}*-1, ({_k}*-1)+({_m}-{_n}) if {_n} >= {_m}-{_t} set {_m} to {_m}-{_t} return ({_k}*-1)+({_m}-{_n}), {_k} if {_n} >= {_m}-{_t} return {_k}, {_k}-({_m}-{_n}-{_t})

This function gets the coordinates of spiral dots from given spiral position. Example: spiral(1) will output you 0, 0, spiral(2) will be 1, 0m spiral(200) will be -7, 4. This can be used to generate islands or plots or a spiral of blocks via multiplying the coordinates.

Easy Legacy Color to Skript Color

Posted by: fusezion Requires: skript-reflect
function colorFormat(text:text) :: text: return {_text}.replaceAll("&##([a-fA-F0-9]{6})", "<##$1>")

Format all your old &#HEX format codes into skript's <#HEX> easily without all the hassle.

Parse Timespan, used for prettify timespan + join function.

Posted by: laybeats
function join(o: objects, s: text) :: text: loop {_o::*}: add loop-value to {_fin::*} add {_s} to {_fin::*} set {_s} to "" loop {_fin::*}: set {_s} to "%{_s}%%loop-value%" return {_s} function parseTimespan(t: text) :: timespan: set {_timespan} to {_t} set {_x::*} to {_timespan} split at "" remove all "" from {_x::*} loop {_x::*}: if loop-value is "s": add " seconds " to {_s::*} else if loop-value is "m": add " minutes " to {_s::*} else if loop-value is "h": add " hours " to {_s::*} else if loop-value is "d": add " days " to {_s::*} else: add loop-value to {_s::*} set {_timespan} to join({_s::*}, "") parsed as timespan return {_timespan}

* This function parses a text as timespan, using the join function (Requires Sk-Reflect) this may also be used for prettify timespan function I have given some time ago (Check it out).

Save and Paste schematics with Fast Async World Edit

Posted by: boxic Requires: skript-reflect
import: com.sk89q.worldedit.bukkit.BukkitWorld com.sk89q.worldedit.extent.clipboard.Clipboard com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats com.sk89q.worldedit.math.BlockVector3 com.sk89q.worldedit.regions.CuboidRegion java.io.File java.nio.file.Files java.nio.file.Paths # Pastes a schematic from a file path to a location, optionally include/exclude air and entities # Example file path: "plugins/FastAsyncWorldEdit/schematics/MySchematic.schem" effect paste schematic %string% at %location% [(1¦(with|including) air)]: trigger: # Get schematic file set {_file} to new File(expression-1) # Get location set {_location} to BlockVector3.at(expression-2.getBlockX(), expression-2.getBlockY(), expression-2.getBlockZ()) set {_world} to new BukkitWorld(expression-2.getWorld()) # Include air? set {_includeAir} to true if parse mark = 1, else false # Paste that bad boy ClipboardFormats.findByFile({_file}).load({_file}).paste({_world}, {_location}, false, {_includeAir}, false, null) # op ("Boxic" parsed as offline player) # jkjk # I'm not that kooky # I'm not that kooky # I'm not that kooky # I'm not that kooky # I'm not that kooky # I-I- I'm not that kooky # (chorus) # Creates a schematic between two locations from an origin location, and saves to a file path # Example file path: "plugins/FastAsyncWorldEdit/schematics/MySchematic.schem" effect create schematic %string% from pos1 %location% pos2 %location% origin %location%: trigger: # Overwrite file if it already exists Files.deleteIfExists(Paths.get(expression-1)) set {_file} to new File(expression-1) # Set selection locations set {_pos1} to BlockVector3.at(expression-2.getBlockX(), expression-2.getBlockY(), expression-2.getBlockZ()) set {_pos2} to BlockVector3.at(expression-3.getBlockX(), expression-3.getBlockY(), expression-3.getBlockZ()) # Set origin location set {_origin} to BlockVector3.at(expression-4.getBlockX(), expression-4.getBlockY(), expression-4.getBlockZ()) set {_world} to new BukkitWorld(expression-2.getWorld()) # Define selection region and copy it to clipboard set {_region} to new CuboidRegion({_world}, {_pos1}, {_pos2}) set {_clipboard} to Clipboard.create({_region}) # Set the origin of copied selection {_clipboard}.setOrigin({_origin}) # Save selection as schematic {_clipboard}.save({_file}, ClipboardFormats.findByFile({_file}))

Setting blocks with Skript is very slow, in-fact, it's one of the few things that can really grind your server to a halt. FAWE is lightning fast, however!
Only problem is I noticed this creates a bunch of temp files in the plugins/FastAsyncWorldEdit/sessions/ folder, which can eat up a little memory. Pretty sure they delete on restart, so deal with it 🙂

GUIs Boxes

Posted by: cheezburga
function getBox(s1: integer = 0, s2: integer = 53) :: integers: set {_topLeft::1} to floor({_s1}/9) set {_topLeft::2} to mod({_s1}, 9) set {_bottomRight::1} to floor({_s2}/9) set {_bottomRight::2} to mod({_s2}, 9) broadcast {_topLeft::*} and {_bottomRight::*} loop (integers from {_topLeft::1} to {_bottomRight::1}): loop (integers from {_topLeft::2} to {_bottomRight::2}): if loop-value-2 is {_topLeft::2} or {_bottomRight::2}: add ((loop-value-1 * 9) + loop-value-2) to {_s::*} continue else if loop-value-1 is {_topLeft::1} or {_bottomRight::1}: add ((loop-value-1 * 9) + loop-value-2) to {_s::*} return {_s::*} command /gui <integer> <integer>: trigger: create gui with virtual chest inventory with 6 rows named "From %arg-1% to %arg-2%": loop getBox(arg-1, arg-2): format gui slot (loop-value) with black stained glass pane named "%loop-value%" open last gui to player

Provides a function which returns all the slots to create a box between the two inputted slots. Returns as a list of integers.

Spawn Mythic Mob

Posted by: boxic Requires: skript-reflect
import: io.lumine.mythic.bukkit.MythicBukkit effect spawn mythic mob %string% at %location%: trigger: MythicBukkit.inst().getAPIHelper().spawnMythicMob(expr-1, expr-2)

Spawn a custom Mythic Mobs mob using their name, and the location to spawn them at

CSO (CommandSyntaxOverride) **FIXED**

Posted by: yuri0nice
on command: set {_cmd} to the command set {_fcmd} to the full command set {_cmd2::*} to {_cmd} split at " " if {_cmd2::1} contains ":": set {_cmd1::*} to {_cmd2::1} split at ":" replace first "%{_cmd1::1}%:" with "/" in {_fcmd} make player execute "%{_fcmd}%" cancel event

Sorry, I uploaded the wrong file :) This one actually works
WARNING: If you do not understand how plugin priority works, I strongly advise you to learn about it, as this essentially only executes the highest priority command, due to the syntax (plugin_name:command) being changed to match anything. So, if you are running litebans and for some reason didn't import from MC default ban-list, you will no longer be able to pardon this, due to LiteBans being the higher priority, and /minecraft:ban becoming /ban, and again, since LiteBans has the higher priority, that /ban or /unban will be its own. (LiteBans is an amazing plugin still)

HOW IT WORKS: CSO or CommandSyntaxOverride essentially makes it so that on a command with syntax (/test:test), it will execute the command "/test" with the highest priority, even if the plugin's syntax isn't test.
So, if you have a skript with priority of 2 that has '/test' command, and then a custom plugin with a priority of 1 that has '/test', rega

Interpolation teleport between points

Posted by: honkchamp
function interpolate(pos: locations, ticks: int): loop size of {_pos::*} - 1 times: set {_movement} to vector from {_pos::%loop-value%} and {_pos::%loop-value + 1%} set vector length of {_movement} to (distance between {_pos::%loop-value%} and {_pos::%loop-value + 1%}) / {_ticks} set {_l} to {_pos::%loop-value%} set {_yawChange} to (yaw of {_pos::%loop-value + 1%} - yaw of {_pos::%loop-value%}) / {_ticks} set {_pitchChange} to (pitch of {_pos::%loop-value + 1%} - pitch of {_pos::%loop-value%}) / {_ticks} loop {_ticks} times: set {_l} to {_l} ~ {_movement} add {_yawChange} to yaw of {_l} add {_pitchChange} to pitch of {_l} teleport all players to {_l} wait 1 tick

Teleports all players between locations given ticks between each point

Get Worldedit selection locations.

Posted by: yodazen Requires: skript-reflect
Import: org.bukkit.Bukkit com.sk89q.worldedit.LocalSession com.sk89q.worldedit.bukkit.BukkitAdapter function getWorldEditSelections(player: player) :: locations: set {_worldedit} to Bukkit.getServer().getPluginManager().getPlugin("WorldEdit") set {_session} to {_ worldedit}.getSession({_player}) set {_selection} to {_session}.getSelection(BukkitAdapter.adapt({_player}.getWorld())) if {_selection} is set: set {_min} to {_selection}.getMinimumPoint() set {_max} to {_selection}.getMaximumPoint() set {_world} to {_selection}.getWorld() set {_locs::1} to location({_min}.getX(), {_min}.getY(), {_min}.getZ(), {_world}) set {_locs::2} to location({_max}.getX(), {_max}.getY(), {_max}.getZ(), {_world}) else: message "&fYou have not made a worldedit selection! &8[&c✘&8]" to {_player} return {_locs::*}

A function, to get the locations of the selected area of a player, using Worldedit API.

Simple particle utilities

Posted by: buggyal
# Notice: This code REQUIRES SkBee's 1.9.0 particle functionality to work. You can download it here: https://github.com/ShaneBeee/SkBee/releases # Project Repo - https://github.com/BuggyAl/Skripticle # skBeeParticle(particle) # Converts a Skript particle to a SkBee particle. # particle: The particle to convert. (Skript particle) function skBeeParticle(particle: particle effect) :: particle: return ({_particle} parsed as particle) # drawLine(pos1, pos2, particle, particleDistance) # Draws a line between two locations using particles. # pos1: The first location. (location) # pos2: The second location. (location) # particle: The particle to use. (SkBee particle) You can view a list of particles here: https://skripthub.net/docs/?id=4542 # particleDistance: The target distance between each particle. Will be adjusted to fit distance between locations. (Default: 0.5) function drawLine(pos1: location, pos2: location, particle: particle, particleDistance: number = 0.5): if {_particleDistance} <= 0: set {_particleDistance} to 0.5 set {_distance} to distance between {_pos1} and {_pos2} set {_particleNum} to round({_distance} / {_particleDistance}) set {_vector} to vector between {_pos1} and {_pos2} set vector length of {_vector} to {_distance} / {_particleNum} set {_loc} to {_pos1} loop {_particleNum} + 1 times: draw 1 {_particle} at {_loc} with extra 0 with force set {_loc} to {_loc} ~ {_vector} # drawPolygon(points, particle, particleDistance) # Draws a shape using a list of points and a particle. # points: A list of locations. (Must be inputted as a Skript list!) # particle: The particle to use. You can view a list of particles here: https://skripthub.net/docs/?id=4542 # particleDistance: The distance between each particle. (Default: 0.5) function drawPolygon(points: locations, particle: particle, particleDistance: number = 0.5): if {_particleDistance} <= 0: set {_particleDistance} to 1 loop (size of {_points::*} times): if {_points::%(loop-value + 1)%} exists: drawLine({_points::%loop-value%}, {_points::%(loop-value + 1)%}, {_particle}, {_particleDistance}) else: drawLine({_points::%loop-value%}, {_points::1}, {_particle}, {_particleDistance})

Allows for the creation of particle lines with configurable particles and distance between each particle. Lines can be combined to make a closed shape.

Auto Totem Skript

Posted by: sluhtie
#Auto totem made by sluhtie (DC: sluhtie) on damage of player: #Check if damage is final final damage >= victim's health victim has 1 of totem of undying #if totem is not in players hand or off hand & remove it victim's offhand tool != a totem of undying victim's tool != a totem of undying remove (1 of totem of undying) from inventory of victim #Create copy of item in offhand. set {_offhand} to victim's offhand tool #Put Totem in offhand. set victim's offhand tool to a totem of undying #Next tick put item back in offhand. (Do this because minecraft deletes any item that is in offhand even if it isn't a totem) wait a tick set victim's offhand tool to {_offhand}

This skript will automatically put a totem in the player's offhand when the damage will kill the player.
It only works if the player has a totem somewhere in his inventory!
(This could be a premium feature of a survival server etc..)

Combat Log

Posted by: burbulinis Requires: SkBee
function combatLogTag(p: player): set {_u} to {_p}'s uuid if combatLogIsTagged({_p}) is true: set {-combatLog::time::%{_u}%} to {combatLog::time} stop set {-combatLog::tagged::%{_u}%} to true set {-combatLog::time::%{_u}%} to {combatLog::time} while {-combatLog::tagged::%{_u}%} is set: send action bar "&cYou are in combat! (&4%{-combatLog::time::%{_u}%}%&c)" to {_p} if {-combatLog::time::%{_u}%} <= 0 seconds: combatLogRemoveTag({_p}) wait 0.1 second remove 0.1 seconds from {-combatLog::time::%{_u}%} function combatLogRemoveTag(p: player): set {_u} to {_p}'s uuid send action bar "&cYou are no longer in combat." to {_p} delete {-combatLog::tagged::%{_u}%} delete {-combatLog::time::%{_u}%} function combatLogIsTagged(p: player) :: boolean: set {_u} to {_p}'s uuid return {-combatLog::tagged::%{_u}%} ? false on damage of player: combatLogTag(victim) combatLogTag(attacker) on death: combatLogRemoveTag(victim) on quit: if combatLogIsTagged(player) is true: kill player on command: if combatLogIsTagged(player) is true: cancel event send "&cYou cannot use commands in combat!" to player command /combatlog <string> <timespan>: permission: op trigger: arg-1 is "setTime" set {combatLog::time} to arg-2 on tab complete: event-string is "/combatlog" player is op set tab completions for position 1 to "setTime"

Functions aren't complicated
only 1 command which is /combatlog setTime <timespan>
Requires SkBee for tab completions

Shulker Box item GUI

Posted by: eult Requires: SkBee
function viewShulkerValue(p: player, item: item): set {_nbt} to (nbt compound of {_item}) set {_items::*} to (compound list tag "BlockEntityTag;Items" of {_nbt}) set metadata tag "ShulkerBoxInChest" of {_p} to shulker box inventory with name "%name of {_item} ? "Shulker box"%" loop {_items::*}: set {_s} to tag "Slot" of loop-value set slot {_s} of metadata tag "ShulkerBoxInChest" of {_p} to (nbt item from loop-value) open (metadata tag "ShulkerBoxInChest" of {_p}) to {_p}

The purpose of this snippet is to allow you to see what's inside the shulker box without having to place it in the box

This Snippet hasn't got a title yet!

Posted by: Collin's
function contains(list: objects, check: object) :: boolean: loop {_list::*}: if loop-value is {_check}: return true return falsecommand /report [<offlineplayer>] [<text>] [<text>]: trigger: if arg 3 is set: send "&cO motivo tem que ser apenas uma palavra." stop if arg 1 is set: if arg 1 is "clear": clear {reports::*} send "&eVocê limpou a lista de reports!" stop if arg 2 is set: if arg 2 is not "delete" or "remove": if arg-1 is player's name: send "&cVocê não pode reportar a si mesmo." stop if {reports::*} contains arg-1: if contains({reports.motivos.%arg-1%::*}, "%arg-2%") is true: add 1 to {reports.%arg-1%} send "&eVocê reportou &b%arg-1% &epor &b%arg-2%" loop all players: if loop-player has permission "reports.ver": json("%loop-player%", "||&cNovo Report!||ttp:&eReportado: &f%arg-1% %nl%&eReportado por: &f%player% %nl%&eMotivo: &f%arg-2%") stop else: add 1 to {reports.%arg-1%} add arg-2 to {reports.motivos.%arg-1%::*} send "&eVocê reportou &b%arg-1% &epor &b%arg-2%" loop all players: if loop-player has permission "reports.ver": json("%loop-player%", "||&cNovo Report!||ttp:&eReportado: &f%arg-1% %nl%&eReportado por: &f%player% %nl%&eMotivo: &f%arg-2%") stop else: clear {reports.%arg-1%} clear {reports.motivos.%arg-1%::*} add arg-1 to {reports::*} add 1 to {reports.%arg-1%} add arg-2 to {reports.motivos.%arg-1%::*} send "&eVocê reportou &b%arg-1% &epor &b%arg-2%" loop all players: if loop-player has permission "reports.ver": json("%loop-player%", "||&cNovo Report!||ttp:&eReportado: &f%arg-1% %nl%&eReportado por: &f%player% %nl%&eMotivo: &f%arg-2%") stop if arg 2 is "delete" or "remove": if player has permission "admin.report": if {reports::*} contains arg-1: remove arg-1 from {reports::*} send "&eVocê removeu &f%arg-1% &eda lista de reports." else: send "&cEste usuário não está na lista de reportes." else: send "&cuse /report (jogador) (delete)" else: send "&cSem permissão!" else: send "&cUse /report (jogador) (motivo)" else: send "&cUse /report (jogador) (motivo)" command /reports: trigger: if {reports::*} is set: send "&eReports:" loop {reports::*}: set {_reportsmotivos} to "%{reports.motivos.%loop-value%::*}%" replace all "and" with "," in {_reportsmotivos} replace all "," with "%nl%-" in {_reportsmotivos} json("@a", "|| &4(x)||ttp:&cClique para remover.||cmd:/report %loop-value% delete|| &f%player%||ttp:&aClique para ir ao Jogador||cmd:/tp %loop-value%|| &c(%{reports.%loop-value%}%)||ttp:Motivos: %nl%- &a%{_reportsmotivos}%") else: send "&cNão possuí reports!"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: sluhtie
condition %offline player% is registered: check: if exprs-1 has played before: continue else if exprs-1 is online: continue

The author hasn't given this Snippet a description yet

Is between/within

Posted by: TF
function isBetween(num: number, num1: number, num2: number) :: boolean: if {_num} > min({_num1}, {_num2}): return true if {_num} < max({_num1}, {_num2}) return false function isWithin(loc: location, pos1: location, pos2: location) :: boolean: if isBetween(x-loc of {_loc}, x-loc of {_pos1}, x-loc of {_pos2}) = true: isBetween(y-loc of {_loc}, y-loc of {_pos1}, y-loc of {_pos2}) = true return true if isBetween(z-loc of {_loc}, z-loc of {_pos1}, z-loc of {_pos2}) = true return false

Check if a number is between or within 2 digits.

This Snippet hasn't got a title yet!

Posted by: FokaStudio
effect send MiniMessage %string% to %players%: trigger: set {_comp} to expr-1 replace all "< " and "<\" with "<" in {_comp} replace all " >" and "\>" with ">" in {_comp} set {_comp} to MiniMessage.get().parse({_comp}) loop exprs-2: loop-value.sendMessage({_comp})

Send a minimessage to one ore more players

This Snippet hasn't got a title yet!

Posted by: Leialoha
import: org.bukkit.Bukkit java.io.Fileon command: if the command label is ("pl" or "plugins"): command sender has permission "ep.skript.list" wait 1 tick set {_main} to new File("./plugins/Skript/scripts/") send " " to sender set {_ewpScripts::*} to skriptList({_main}, false, false) set {_eScripts::*} to skriptList({_main}, false, true) set {_skripts::*} to skriptFinder({_ewpScripts::*}, {_eScripts::*}) set {_n} to size of {_skripts::*} set {_skripts} to join {_skripts::*} with " " send "&fEnabled Skripts (%{_n}%): %{_skripts}%" to sender send " " to sender set {_dwpScripts::*} to skriptList({_main}, true, false) set {_dScripts::*} to skriptList({_main}, true, true) set {_dskripts::*} to skriptFinder({_dwpScripts::*}, {_dScripts::*}) set {_dn} to size of {_dskripts::*} set {_dskripts} to join {_dskripts::*} with " " replace "&a" in {_dskripts} with "&c" if "%{_dskripts}%" is "<none>": set {_dskripts} to "&c" send "&fDisabled Skripts (%{_dn}%): %{_dskripts}%" to sender function skriptFinder(v1: objects, v2: objects) :: objects: set {_pathskripts::*} to updateList({_v2::*}, {_v1::*}, false) set {_skripts::*} to updateList({_v2::*}, {_v1::*}, true) set {_skripts::*} to sorted {_skripts::*} set {_pathskripts::*} to sorted {_pathskripts::*} loop {_pathskripts::*}: add loop-value to {_skripts::*} set {_skripts::*} to split {_skripts} by " " return {_skripts::*} function skriptList(file: object, disabled: boolean, includePath: boolean) :: objects: if {_file}.isDirectory() is true: set {_files} to {_file}.listFiles() set {_files::*} to split "%{_files}%" by ", " loop {_files::*}: set {_returns::*} to skriptList(new File(loop-value-1), {_disabled}, {_includePath}) loop {_returns::*}: add "%loop-value-2%" to {_return::*} else: set {_file} to "%{_file}%" replace "./plugins/Skript/scripts/" in {_file} with "" set {_files::*} to {_file} split by "/" set {_n} to size of {_files::*} set {_continued} to false if {_disabled} is true: if first character of {_files::%{_n}%} is "-": set {_continued} to true if {_disabled} is false: if first character of {_files::%{_n}%} is not "-": set {_continued} to true if {_continued} is true: if {_includePath} is true: add "%{_file}%" to {_return::*} else: add "%{_files::%{_n}%}%" to {_return::*} return {_return::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Wooferz
# Silk Touch Hands like Ranboo options: playername: "Woooferz" on break: if player is {@playername}: if player's held item is 0 air: cancel event set event-block to air drop event-block at event-block

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: barry
function findNearestEntity(obj: object, rad: number) :: object: loop all entities in radius {_rad} around {_obj} where [entity input != {_obj}]: set {_closest} to loop-value if (distance between {_obj} and loop-entity) < ({_closest}) return ((location of {_closest}) otherwise "No entities found in radius %{_rad}%")

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: british
real second: if {Timer::Running} is true: if {Timer::Time} is set: remove 1 second from {Timer::Time} if {Timer::Time} is 0 seconds: delete {Timer::Time} delete {Timer::Message} set {Timer::Repeat} to false set {Timer::Running} to false broadcast "{@P} {@A} Timer has finished." every 15 ticks: if {Timer::Running} is true: send action bar "&6%{Timer::Message}% {@A} &6%time format from {Timer::Time}%" to all players expression: return type: text patterns: time format from %timespan% get: set {_time} to (expr-1.getTicks()/20) set {_d} to rounded down ((({_time}/60)/60)/24) remove {_d}*60*60*24 from {_time} set {_h} to rounded down ((({_time}/60)/60)) remove {_h}*60*60 from {_time} set {_m} to rounded down ((({_time}/60))) remove {_m}*60 from {_time} set {_s} to rounded down ((({_time}))) loop "d", "h", "m" and "s": {_%loop-value%} is not 0: add "%{_%loop-value%}%&7%loop-value%&6" to {_t::*} return join {_t::*} by ""

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: pesekjan
import: java.util.UUID java.util.List java.net.InetAddress io.netty.channel.ChannelInboundHandlerAdapter io.netty.channel.embedded.EmbeddedChannel org.bukkit.Bukkit org.bukkit.event.player.PlayerPreLoginEvent org.bukkit.event.player.AsyncPlayerPreLoginEvent org.bukkit.event.player.PlayerJoinEvent org.bukkit.event.player.PlayerResourcePackStatusEvent org.bukkit.event.player.PlayerQuitEvent org.bukkit.craftbukkit.v1_17_R1.util.CraftChatMessage com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent com.destroystokyo.paper.PaperConfig io.papermc.paper.adventure.PaperAdventure net.kyori.adventure.text.Component net.kyori.adventure.text.format.NamedTextColor ch.njol.skript.Skript ch.njol.skript.ServerPlatform ch.njol.skript.classes.Changer$ChangerUtils ch.njol.skript.classes.Changer$ChangeMode com.mojang.authlib.GameProfile net.minecraft.EnumChatFormat net.minecraft.world.level.EnumGamemode net.minecraft.server.level.EntityPlayer net.minecraft.server.network.PlayerConnection net.minecraft.network.NetworkManager net.minecraft.network.protocol.EnumProtocolDirection net.minecraft.network.chat.ChatMessage net.minecraft.server.players.PlayerList net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo$EnumPlayerInfoAction net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy net.minecraft.stats.StatisticList effect connect [new] [ro]bot with [nick]name %text% [and uuid %-text%] [to server] saved to %object%: parse: continue if ChangerUtils.acceptsChange(expr-3, ChangeMode.SET and text) is true Skript.error("'%expr-3%' can't be changed") trigger: delay the effect set {_platform} to Skript.getServerPlatform() set {_worldServer} to Bukkit.getWorlds().get(0).getHandle() set {_mcServer} to Bukkit.getServer().getServer() set {_uuid} to random uuid if expr-2 is not set, else expr-2 set {_uuid} to UUID.fromString({_uuid}) set {_gameProfile} to new GameProfile({_uuid}, expr-1) set {_entityPlayer} to new EntityPlayer({_mcServer}, {_worldServer}, {_gameProfile}) set {_bukkitPlayer} to {_entityPlayer}.getBukkitEntity() set {_protocolDirection} to EnumProtocolDirection.b set {_playerConnection} to new PlayerConnection({_mcServer}, new NetworkManager({_protocolDirection}), {_entityPlayer}) set {_entityPlayer}.b to {_playerConnection} set {_embeddedChannel} to new EmbeddedChannel(new ChannelInboundHandlerAdapter()) set {_entityPlayer}.b.a.k to {_embeddedChannel} {_entityPlayer}.b.a.k.close() set {_preLoginEvent} to new PlayerPreLoginEvent("Notch", InetAddress.getByName("127.0.0.1"), {_uuid}) set {_asyncPreLoginEvent} to new AsyncPlayerPreLoginEvent("Notch", InetAddress.getByName("127.0.0.1"), {_uuid}) create new section with {_pesexy} stored in {_asyncPreLoginEventSection}: Bukkit.getPluginManager().callEvent({_asyncPreLoginEvent}).start() return "pesexy" run section {_asyncPreLoginEventSection} async with "pesexy" and store result in {_} and wait Bukkit.getPluginManager().callEvent({_preLoginEvent}).start() {_mcServer}.getPlayerList().a({_entityPlayer}) set {_loc} to {_bukkitPlayer}.getLocation() {_entityPlayer}.setLocation({_loc}.getX(), {_loc}.getY(), {_loc}.getZ(), {_loc}.getYaw(), {_loc}.getPitch()) set {_gameProfile} to {_entityPlayer}.getProfile() set {_userCache} to Bukkit.getServer().getServer().getUserCache() set {_cacheProfile} to {_userCache}.getProfile({_gameProfile}.getId()) set {_s} to {_gameProfile}.getName() ? {_cacheProfile}.getName() set {_joinMessage} to (new ChatMessage("multiplayer.player.joined", {_entityPlayer}.getScoreboardDisplayName())) if {_entityPlayer}.getProfile().getName().equalsIgnoreCase({_s}), else (new ChatMessage("multiplayer.player.joined.renamed", {_entityPlayer}.getScoreboardDisplayName(), {_s})) set {_chatColor} to EnumChatFormat.o {_joinMessage}.a({_chatColor}) if {_platform} is ServerPlatform.BUKKIT_PAPER: set {_playerInitialSpawnEvent} to new PlayerInitialSpawnEvent({_bukkitPlayer}, {_bukkitPlayer}.getLocation()) Bukkit.getPluginManager().callEvent({_playerInitialSpawnEvent}) {_entityPlayer}.spawnIn({_worldServer}) {_entityPlayer}.d.a({_worldServer}) {_entityPlayer}.d.a(EnumGamemode.c, EnumGamemode.c) {_worldServer}.addPlayerJoin({_entityPlayer}) {_mcServer}.getPlayerList().j.add({_entityPlayer}) set {_playerJoinEvent} to new PlayerJoinEvent({_bukkitPlayer}, CraftChatMessage.fromComponent({_joinMessage})) if {_platform} is ServerPlatform.BUKKIT_PAPER: set {_playerJoinEvent} to new PlayerJoinEvent({_bukkitPlayer}, PaperAdventure.asAdventure({_joinMessage})) Bukkit.getPluginManager().callEvent({_playerJoinEvent}) set {_finalJoinMessage} to {_playerJoinEvent}.getJoinMessage() send {_finalJoinMessage} to all players if {_finalJoinMessage} is not "" set {_resourcePackStatusEventAccepted} to new PlayerResourcePackStatusEvent({_bukkitPlayer}, PlayerResourcePackStatusEvent.Status.ACCEPTED) set {_resourcePackStatusEventSuccessfullyLoaded} to new PlayerResourcePackStatusEvent({_bukkitPlayer}, PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED) if {_platform} is ServerPlatform.BUKKIT_PAPER: {_bukkitPlayer}.setResourcePackStatus(PlayerResourcePackStatusEvent.Status.ACCEPTED) {_bukkitPlayer}.setResourcePackStatus(PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED) else: Bukkit.getPluginManager().callEvent({_resourcePackStatusEventAccepted}) Bukkit.getPluginManager().callEvent({_resourcePackStatusEventSuccessfullyLoaded}) set {_playerInfoPacket} to new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.a, {_entityPlayer}) set {_spawnPlayerPacket} to new PacketPlayOutNamedEntitySpawn({_entityPlayer}) loop all players: set {_connection} to (loop-player).getHandle().b {_connection}.sendPacket({_playerInfoPacket}) {_connection}.sendPacket({_spawnPlayerPacket}) create section with {_pesexy} stored in {_doTick}: while {_bukkitPlayer} is online: {_entityPlayer}.playerTick() wait a tick run section {_doTick} async with "pesexy" and store result in {_} and wait set raw expr-3 to {_entityPlayer} continue effect disconnect [ro]bot %object% [from server]: trigger: delay the effect set {_platform} to Skript.getServerPlatform() set {_worldServer} to Bukkit.getWorlds().get(0).getHandle() set {_mcServer} to Bukkit.getServer().getServer() set {_craftServer} to Bukkit.getServer() set {_entityPlayer} to expr-1 set {_bukkitPlayer} to {_entityPlayer}.getBukkitEntity() {_entityPlayer}.a(StatisticList.j) {_entityPlayer}.o() if {_platform} is ServerPlatform.BUKKIT_PAPER: set {_playerQuitEvent} to new PlayerQuitEvent({_bukkitPlayer}, Component.translatable("multiplayer.player.left", NamedTextColor.YELLOW, {_bukkitPlayer}.displayName() if PaperConfig.useDisplayNameInQuit, else Component.text({_bukkitPlayer}.getName())), {_entityPlayer}.quitReason) else: set {_playerQuitEvent} to new PlayerQuitEvent({_bukkitPlayer}, join "ยงe", {_entityPlayer}.getName(), " left the game" using "") Bukkit.getPluginManager().callEvent({_playerQuitEvent}) {_entityPlayer}.getBukkitEntity().disconnect({_playerQuitEvent}.getQuitMessage()) if {_mcServer}.isMainThread(): {_entityPlayer}.playerTick() if size of all items in {_bukkitPlayer}'s inventory is not 0: {_bukkitPlayer}'s tool is not air {_entityPlayer}.drop({_carried}, false) {_entityPlayer}.decouple() {_worldServer}.a({_entityPlayer}) {_entityPlayer}.getAdvancementData().a() {_mcServer}.getPlayerList().j.remove({_entityPlayer}) delete {-bot::%expr-1%} set {_finalQuitMessage} to {_playerQuitEvent}.getQuitMessage() send {_finalQuitMessage} to all players if {_finalQuitMessage} is not "" set {_playerInfoPacket} to new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.e, {_entityPlayer}) set {_destroyEntityPacket} to new PacketPlayOutEntityDestroy({_entityPlayer}.getId()) loop all players: set {_connection} to (loop-player).getHandle().b {_connection}.sendPacket({_playerInfoPacket}) {_connection}.sendPacket({_destroyEntityPacket})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: pesekjan
import: java.net.URL java.io.BufferedReader java.io.InputStreamReader java.io.DataOutputStream java.nio.charset.StandardCharsets ch.njol.skript.Skript ch.njol.skript.classes.Changer$ChangerUtils ch.njol.skript.classes.Changer$ChangeMode effect post [new] haste[bin] with data %text% (0¦returning raw|1¦) [with agent %-text%] saved to %object%: parse: continue if ChangerUtils.acceptsChange(expr-3, ChangeMode.SET and text) is true Skript.error("'%expr-3%' can't be changed") trigger: delay the effect run section {-hastebinPost} async with expr-1, (true if parse mark is 0, else false) and (expr-2 ? "Pesexy") and store result in {_result} and wait set raw expr-3 to {_result} continue on load: create new section with {_data}, {_raw} and {_agent} stored in {-hastebinPost}: set {_postData::*} to ...{_data}.getBytes(StandardCharsets.UTF_8) set {_postDataArray} to [{_postData::*}] set {_postDataLength} to (size of {_postData::*}).intValue() set {_requestURL} to new URL("https://hastebin.com/documents") set {_connection} to {_requestURL}.openConnection() {_connection}.setDoOutput(true) {_connection}.setInstanceFollowRedirects(false) {_connection}.setRequestMethod("POST") {_connection}.setRequestProperty("User-Agent", {_agent}) {_connection}.setRequestProperty("Content-Length", Integer.toString({_postDataLength})) {_connection}.setUseCaches(false) set {_os} to {_connection}.getOutputStream() set {_wr} to new DataOutputStream({_os}) {_wr}.write({_postDataArray}) set {_reader} to new BufferedReader(new InputStreamReader({_connection}.getInputStream())) set {_response} to {_reader}.readLine() if {_response} contains """key""": set {_response} to {_response}.substring({_response}.indexOf(":") 2, {_response}.length() - 2) set {_postURL} to "https://hastebin.com/raw/" if {_raw} is true, else "https://hastebin.com/" set {_response} to join {_postURL} and {_response} using "" return {_response}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
# -- Snippet function wrap(text: text, width: integer = 30) :: texts: return {_text} if (length of {_text}) <= {_width} set {_words::*} to split {_text} at " " set {_lines} to "" set {_trimmed} to "" loop {_words::*}: if (length of {_trimmed} 1 length of loop-value) <= {_width}: set {_trimmed} to "%{_trimmed}%%loop-value% " else: set {_lines} to "%{_lines}%%{_trimmed}%%line break%" set {_trimmed} to "%loop-value% " if (length of {_trimmed}) > 0: set {_lines} to "%{_lines}%%{_trimmed}%" return "%{_lines}%%line break%" # -- Example # [INPUT] # broadcast wrap("Hello there. This is a really long string!", 20) # [OUTPUT] # Hello there. This is # a really long # string!

This function breaks a string into multiple lines to make it more readable. The first argument is the text that you want to break up. The second argument determines how many characters each line should have. The function will return one string with newline characters at the wrap points

This Snippet hasn't got a title yet!

Posted by: FokaStudio
effect push %entities% in random direction with speed %number%: trigger: set {_directions::*} to north, south, east, west, northwest, northeast, southwest and southeast set {_push} to a random element out of {_directions::*} push exprs-1 {_push} at speed exprs-2 chance of 50%: set {_directions::*} to up and down set {_push} to a random element out of {_directions::*} push exprs-1 {_push} at speed exprs-2

This effect will ush the entity in a randomly selected cardinal direction

This Snippet hasn't got a title yet!

Posted by: Deleted User b40b29d2
property condition native: check: continue if name of expr-1 is "Chest", "Cartography Table", "Blast Furnace", "Smoker", "Repair & Disenchant", "Upgrade Gear", "Crafting" ,"Furnace" ,"Repair & Name", "Minecart with Chest", "Dropper", "Dispenser", "Item Hopper" or "Llama"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: barry
function sendMeme(player: players): send ("&fYou just got &cmemed!") to ({_player::*})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
effect %string% *^ %integer%: trigger: loop expr-2 times: add expr-1 to {_O::*} set {_} to join ({_O::*}, expr-1) broadcast {_} expression %string% *^ %integer%: get: loop expr-2 times: add expr-1 to {_O::*} set {_} to join ({_O::*}, expr-1) broadcast {_}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
expression %string% *^ %integer%: get: loop expr-2 times: add expr-1 to {_O::*} set {_} to join ({_O::*}, expr-1) return {_}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: DeafMole
function ProgressBar(cur:number,max:num,size:integer) :: text: set {_percent} to {_size}*({_cur}/{_max}) loop {_size} times: if loop-value is greater than {_percent}: add "&f&l&m " to {_list::*} else: add "&c&l&m " to {_list::*} return join {_list::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Hashed_Ice
import: java.util.Arrays java.util.stream.Collectors net.minecraft.network.protocol.game.PacketPlayOutPosition net.minecraft.network.protocol.game.PacketPlayOutPosition$EnumPlayerTeleportFlags on script load: set {_TPFlags} to PacketPlayOutPosition.EnumPlayerTeleportFlags set {_flags::*} to ({_TPFlags}.d), ({_TPFlags}.b), ({_TPFlags}.a), ({_TPFlags}.c) and ({_TPFlags}.e) set {_flagArray} to [{_flags::*} as {_TPFlags}] set {crackshot::teleportation::set} to Arrays.stream({_flagArray}).collect(Collectors.toSet()) effect rotate %player% by %number% horizontally and %number% vertically: trigger: set {_p} to expression 1 set {_bool} to {_p}.isOnGround() set {_yaw} to expression 2 * 256 / 360 set {_pitch} to expression 3 * 256 / 360 set {_args::*} to 0, 0, 0, {_yaw}, {_pitch}, {crackshot::teleportation::set}, 1 and {_bool} set {_packet} to new PacketPlayOutPosition({_args::*}) expression 1.getHandle().b.sendPacket({_packet})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Ankoki
import: com.sk89q.worldedit.math.BlockVector3 com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats com.sk89q.worldedit.function.operation.Operations com.sk89q.worldedit.session.ClipboardHolder com.sk89q.worldedit.WorldEdit com.sk89q.worldedit.bukkit.BukkitAdapter java.io.File java.io.FileInputStream effect paste schematic %string% at %location%: trigger: set {_file} to new File(expr-1) set {_vector} to BlockVector3.at(expr-2.getX(), expr-2.getY(), expr-2.getZ()) set {_format} to ClipboardFormats.findByFile({_file}) set {_reader} to {_format}.getReader(new FileInputStream({_file})) set {_clipboard} to {_reader}.read() set {_session} to WorldEdit.getInstance().getEditSessionFactory().getEditSession(BukkitAdapter.adapt(expr-2.getWorld()), -1) set {_operation} to new ClipboardHolder({_clipboard}).createPaste({_session}).to({_vector}).ignoreAirBlocks(false).build() Operations.complete({_operation}) {_session}.flushSession()

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Salman
death: if victim is a pig: give attacker 1 porkchop named "&ePorkchop" with lore "&6★☆☆☆☆", "&f", "&7Type: &eResource", "&7Rarity: &fCommon"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Fusezion ?
function colorValidator(string:string) :: boolean: if colored {_string} doesn't match "^(?i)§x(§[a-f0-9]){6}$" or "^(?i)§[a-f0-9]$": return false return true # Example on load: broadcast "& e - %colorValidator("&e")%" # true broadcast "< ##ff0000 > - %colorValidator("<##ff0000>")%" # true broadcast "& n - %colorValidator("&n")%" # false

Creates an easy method to validate both color codes and hex codes ensuring it's valid.

This Snippet hasn't got a title yet!

Posted by: eren.
expression number[s] from [string] %string%: get: return (join (regex expr-1 split at "[^0-9]") with "") parsed as number

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
expression [SKill] tier of [potion of] %potion effect type% of %entity%: return type: number get: return expr-2.getPotionEffect(expr-1).getAmplifier()+1

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Bonnie20402
options: PASTA_DADOS: plugins/BonnieRankup/warpson skript load: LoadWarpsData()function LoadWarpsData(): clear {-warps::*} if file path "{@PASTA_DADOS}\warps.json" is not available: sync create file path "{@PASTA_DADOS}\warps.json" broadcast "&a[WARPS] Ficheiro corrompido ou não criado ({@PASTA_DADOS}/warps.json)" clear {-warps::*} set {_warps::*} to content of file path "{@PASTA_DADOS}\warps.json" set {_x} to join {_warps::*} copy json {_x} to {-warps::*} set {_quantidade} to 0 loop {-warps::*}: add 1 to {_quantidade} broadcast "&a[WARPS] &e%{_quantidade}% &awarps carregados" CreateWarpsGui()function CreateWarp(name:string,x:string,y:string,z:string,w:string,b:string,desc:string) :: integer: if {-warps::%{_name}%::x} is set: set {_alreadyExists} to 1 set {-warps::%{_name}%::x} to {_x} set {-warps::%{_name}%::y} to {_y} set {-warps::%{_name}%::z} to {_z} set {-warps::%{_name}%::logo} to {_b} set {-warps::%{_name}%::world} to {_w} set {-warps::%{_name}%::desc} to {_desc} return 0 if {_alreadyExists} = 1 return 1function TeleportPlayerToWarp(p:player,name:string) :: integer: if {-warps::%{_name}%::x} is set: set {_x} to {-warps::%{_name}%::x} parsed as number set {_y} to {-warps::%{_name}%::y} parsed as number set {_z} to {-warps::%{_name}%::z} parsed as number set {_w} to "%{-warps::%{_name}%::world}%" teleport {_p} to location({_x},{_y},{_z},{_w}) return 1 else: return 0function DeleteWarp(name:string) :: integer: if {-warps::%{_name}%} is not set: return 0 else: delete {-warps::%{_name}%::*} delete {-warps::%{_name}%} SaveWarpsData() return 1 function SaveWarpsData(): set {_Ficheiro} to json form of {-warps::*} sync delete file path "{@PASTA_DADOS}/warps.json" sync create file path "{@PASTA_DADOS}/warps.json" with content "%{_Ficheiro}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: PF0
formatTicks(t: number) :: text: return "%floor({_t}/1200)%:%zero(floor(mod({_t},1200)/20),2)%.%zero(mod({_t},20)*5,2)%" #EXAMPLE COMMAND command /countdown: trigger: loop 200 times: send action bar "Time left: &7%formatTicks(200 - loop-number)%" to player wait 1 tick send action bar "" to player send "&cTime up"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
function splitAt(str: string, n: integer) :: strings: if {_n} > 0: return regex split {_str} at "(?<=\G.{%{_n}%})" return {_str}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
expression wrap %string% using %string% with width %integer%: return type: string get: return expr-1 if {_width} < 2 return join (regex split expr-1.replaceAll("(.{1,%expr-3%})(?:\s+|$)|(.{1,%expr-3%})", "$1$2%expr-2%") at "%expr-2%$") # example set {_lore} to wrap "This is a very long line that I would like to efficiently split up into smaller lines for readability." using "%nl%&7" with width 30 set lore of {_tool} to "&7%{_lore}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Sorbon
import: org.bukkit.Bukkit function setTablistOrder(p:player, place:object): set {sbt::%{_p}%} to "%{_place}%" {_p}.setScoreboard({-sb}) set {sb::%{_place}%} to {-sb}.registerNewTeam("%{_place}%") if {sb::%{_place}%} is not set {sb::%{sb}.getEntryTeam({_p}'s name).getName()%}.removeEntry({_p}'s name) {sb::%{_place}%}.addEntry({_p}'s name) function reloadTablistOrder(p:players): set {-sb} to Bukkit.getScoreboardManager().getNewScoreboard() if {-sb} is not set loop {_p::*}: setTablistOrder(loop-value, {sbt::%loop-value%}) on load: reloadTablistOrder(all players) on join: reloadTablistOrder(player)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: A P P L E
function exponent(i: integer) :: text: set {_l::*} to "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹", "⁰" add "%{_i}%" split at "" to {_il::*} set {_n} to 1 loop {_il::*}: {_n} < size of {_il::*} loop-value parsed as integer = 0: add {_l::10} to {_b::*} else: add {_l::%loop-value parsed as integer%} to {_b::*} set {_c} to join {_b::*} return {_c}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
event "BiomeSwitchEvent": pattern: [on] [player] biome (switch|change) event-values: player on join: while player is online: set {_data::old_biome} to ({-biome::%uuid of player%} ? biome at player) set {_data::new_biome} to biome at player set {-biome::%uuid of player%} to biome at player if {_data::old_biome} != {_data::new_biome}: set {_values::player} to event-player set {_event} to custom event "BiomeSwitchEvent" with {_values::*} and data {_data::*} call {_event} wait 1 second expression old biome: usable in: custom event "BiomeSwitchEvent" return type: biome get: return event.getData("old_biome") expression new biome: usable in: custom event "BiomeSwitchEvent" return type: biome get: return event.getData("new_biome")

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
import: com.ticxo.modelengine.api.ModelEngineAPI com.ticxo.modelengine.api.model.ActiveModel com.ticxo.modelengine.api.model.ModeledEntity org.bukkit.entity.EntityType org.bukkit.event.entity.EntityTeleportEvent effect spawn modeled entity %string% [at %location%] [with %-string% base entity]: trigger: set {_model} to expr-1 set {_baseentity} to (try EntityType.valueOf(expr-3 in uppercase)) otherwise EntityType.PIG set {_loc} to expr-2 set {_entity} to {_loc}.getWorld().spawnEntity({_loc}, {_baseentity}) set {_modeledentity} to ModelEngineAPI.createModeledEntity({_entity}) set {_activemodel} to ModelEngineAPI.createActiveModel({_model}) {_modeledentity}.addActiveModel({_activemodel}) {_modeledentity}.detectPlayers() {_modeledentity}.setInvisible(true)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TenFont
effect create arena [named] %text% between %location% and %location%: trigger: world of expr-2 = world of expr-3 set {_x} to min(x-loc of expr-2, x-loc of expr-3) set {_y} to min(y-loc of expr-2, y-loc of expr-3) set {_z} to min(z-loc of expr-2, z-loc of expr-3) set {_location} to location({_x}, {_y}, {_z}, (world of expr-2)) set {structures::%expr-1%} to {_location} set {_structure} to structure named expr-1 fill {_structure} between expr-2 and expr-3 save {_structure} effect delete (1¦arena [named] %-text%|2¦all arenas): trigger: if parser mark is 1: {structures::%expr-1%} is set delete {structures::%expr-1%} delete structure named expr-1 else: loop indices of {structures::*}: delete {structures::%loop-value%} delete structure named loop-value effect reset (1¦arena [named] %-text%|2¦all arenas) trigger: if parser mark is 1: {structures::%expr-1%} is set set {_structure} to structure named expr-1 place {_structure} at {structures::%expr-1%} else: loop {structures::*}: set {_structure} to structure named (loop-index) place {_structure} at (loop-value)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
function Fortune(l:integer) :: integer: loop {_l} times: add 1 to {_r} if chance of (100/({_l}+2))% return {_r}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: eGems
link: trigger: set {_code} to a random integer between 11111 and 99999 set {code::%{_code}%} to player send "&d&lSugar&e&lBox &7Your unique is &e%{_code}%&7. Run the command !link &e%{_code}%&7 on our discord to link your account. This code will be deleted in 2 minutes." wait 2 minutes delete {code::%{_code}%} discord command link [<text>]: prefixes: ! trigger: if arg-1 is not set: reply with "Syntax: !link (code)" stop if {code::%arg-1%} is not set: reply with "Invalid code" stop add role with id "1002921485461106688" to {code::%arg-1%} set {discord::%discord id of event-member%::username} to {code::%arg-1%} reply with "You have linked with the Minecraft account %{code::%arg-1%}%." set member nickname of event-member to "{code::%arg-1%}" delete {code::%arg-1%}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: schrill
import: com.rexcantor64.triton.api.TritonAPI com.rexcantor64.triton.api.players.PlayerManager com.rexcantor64.triton.api.language.LanguageManageron load: set {tritonapi} to TritonAPI.getInstance()offline player property [activ(e|ated)] [triton] lang[uage] [(1¦name|2¦code|3¦locale)]: return type: string get: parse mark = 1: set {_manager} to {tritonapi}.getPlayerManager() set {_p} to {_manager}.get(expr-1.getUniqueId()) return {_p}.getLang().getDisplayName() else: set {_manager} to {tritonapi}.getPlayerManager() set {_p} to {_manager}.get(expr-1.getUniqueId()) return {_p}.getLang().getName() set: set {_manager} to {tritonapi}.getPlayerManager() set {_langmanager} to {tritonapi}.getLanguageManager() set {_p} to {_manager}.get(expr-1.getUniqueId()) set {_lang} to {_langmanager}.getLanguageByName(change value, false) {_p}.setLang({_lang})string property [triton] trans(lation|lated) [(string|text|message)] in[to] %string% [with [optional] [arg[ument[s]]] %-objects%]: return type: string get: set {_manager} to {tritonapi}.getLanguageManager() return {_manager}.getText(expr-2, expr-1) if expr-3 is not set return {_manager}.getText(expr-2, expr-1, exprs-3) if expr-3 is set

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: schrill
import: com.rexcantor64.triton.api.TritonAPI com.rexcantor64.triton.api.players.PlayerManager com.rexcantor64.triton.api.language.LanguageManager on load: set {tritonapi} to TritonAPI.getInstance() offline player property [activ(e|ated)] [triton] lang[uage] [(1¦name|2¦code|3¦locale)]: return type: string get: parse mark = 1: set {_manager} to {tritonapi}.getPlayerManager() set {_p} to {_manager}.get(expr-1.getUniqueId()) return {_p}.getLang().getDisplayName() else: set {_manager} to {tritonapi}.getPlayerManager() set {_p} to {_manager}.get(expr-1.getUniqueId()) return {_p}.getLang().getName() set: set {_manager} to {tritonapi}.getPlayerManager() set {_langmanager} to {tritonapi}.getLanguageManager() set {_p} to {_manager}.get(expr-1.getUniqueId()) set {_lang} to {_langmanager}.getLanguageByName(change value, false) {_p}.setLang({_lang}) string property [triton] trans(lation|lated) [(string|text|message)] in[to] %string% [with [optional] [arg[ument[s]]] %-objects%]: return type: string get: set {_manager} to {tritonapi}.getLanguageManager() return {_manager}.getText(expr-2, expr-1) if expr-3 is not set return {_manager}.getText(expr-2, expr-1, exprs-3) if expr-3 is set

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Jake*
import: com.plotsquared.core.PlotSquared com.plotsquared.core.location.Location condition %player% ((0¦|1¦does(n't| not))own[s]|is(0¦|1¦(n't| not)) [the] owner of [the]) plot at %location%: check: set {_final} to true if parse mark = 0 else false set {_player} to expr-1 set {_location} to expr-2 set {_world} to "%world of {_location}%" set {_x} to x-loc of {_location} set {_y} to y-loc of {_location} set {_z} to z-loc of {_location} set {_loc} to Location.at({_world},{_x},{_y},{_z}) set {_pa} to PlotSquared.get().getPlotAreaManager().getPlotArea({_loc}) {_pa} is set set {_plot} to {_pa}.getPlot({_loc}) continue if {_plot}.isOwnerAbs({_player}.getUniqueId()) is {_final}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: eren.
import: me.neznamy.tab.api.TabAPI me.neznamy.tab.api.scoreboard.ScoreboardManager java.util.List on load: set {TAB_API} to TabAPI.getInstance() function sb_set_lines(p: players, lines: strings): set {_sb.instance} to {TAB_API}.getScoreboardManager() set {_lines} to List.of({_lines::*}) set {_scoreboard} to {_sb.instance}.createScoreboard("scoreboard", "title", {_lines}) loop {_p::*}: set {_player} to {TAB_API}.getPlayer(loop-value.getUniqueId()) {_sb.instance}.showScoreboard({_player}, {_scoreboard}) function sb_clear(p: players): set {_sb.instance} to {TAB_API}.getScoreboardManager() loop {_p::*}: set {_player} to {TAB_API}.getPlayer(loop-value.getUniqueId()) {_sb.instance}.resetScoreboard({_player})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: eren.
import: me.neznamy.tab.api.TabAPI me.neznamy.tab.api.scoreboard.ScoreboardManager java.util.List on load: set {TAB_API} to TabAPI.getInstance() function sb_set_lines(p: players, title: string, lines: strings): set {_sb.instance} to {TAB_API}.getScoreboardManager() set {_lines} to List.of({_lines::*}) set {_scoreboard} to {_sb.instance}.createScoreboard("scoreboard", {_title}, {_lines}) loop {_p::*}: set {_player} to {TAB_API}.getPlayer(loop-value.getUniqueId()) {_sb.instance}.showScoreboard({_player}, {_scoreboard}) function sb_clear(p: players): set {_sb.instance} to {TAB_API}.getScoreboardManager() loop {_p::*}: set {_player} to {TAB_API}.getPlayer(loop-value.getUniqueId()) {_sb.instance}.resetScoreboard({_player})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Honk
function getClosest(p: player) :: player: loop all players: loop-player != {_p} set {_l::%loop-player%} to (distance between loop-player and {_p}) loop sorted indicies of {_l::*}: return loop-index

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Giuca002
guislots <number>: permission: slots.guislots description: Shows the slots in a inventory, usefull for development. trigger: if arg-1 is less than 1: send "&cIt needs to be more than 0." stop else if arg-1 is more than 6: send "&cIt needs to be less than 6." stop else: guiSlots(player, arg-1) function guiSlots(p: player,r: number) set {_slots} to {_r} * 9 set {_amount} to 0 set {_gui.data} to chest inventory with {_r} rows named {slots.name} set {slots.gui} to "Slots in a %{_r}% row inventory" loop {_slots} times: if {_amount} is 0: set slot {_amount} of {_gui.data} to 1 light gray stained glass pane named "Slot %{_amount}" else: set slot {_amount} of {_gui.data} to {_amount} of light gray stained glass pane named "Slot %{_amount}%" add 1 to {_amount} open {_gui.data} to {_p} on inventory click: if name of inventory is {slots.gui}: cancel the event

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
function getShulkerItems(shulker:item) :: items: ({_shulker}) is (any shulker box) set ({_nbt::*}) to ((compound list tag) ("tag;BlockEntityTag;Items") of (nbt compound of ({_shulker}))) return (item from nbt ({_nbt::*}))

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Honk
function timeConvert(t: text) :: text: set {_m} to {_t} parsed as an integer / 60 set {_s} to ({_m} - rounded down {_m}) * 60 set {_m} to rounded down {_m} loop 4 times: set {_d::%loop-value%} to 0 set {_split.m::*} to "%{_m}%" split by "" if size of {_split.m::*} > 2: set {_d::1} to 1st element of {_split.m::*} set {_d::2} to 2st element of {_split.m::*} else: set {_d::2} to 1st element of {_split.m::*} set {_split.s::*} to "%{_s}%" split by "" if size of {_split.s::*} > 2: set {_d::3} to 1st element of {_split.s::*} set {_d::4} to 2st element of {_split.s::*} else: set {_d::4} to 1st element of {_split.s::*} return "%{_d::1}%%{_d::2}%:%{_d::3}%%{_d::4}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: schrill
property better [time[span]]: return type: string get: set {_time} to expr-1.getTicks()/20 set {_days} to round floor({_time}/86400) set {_hours} to mod(round floor({_time}/3600), 24) set {_minutes} to mod(round floor({_time}/60), 60) set {_seconds} to mod({_time}, 60) {_days} != 0: return "%{_days}%d %{_hours}%h %{_minutes}%m %{_seconds}%s" else: {_hours} != 0: return "%{_hours}%h %{_minutes}%m %{_seconds}%s" else: {_minutes} != 0: return "%{_minutes}%m %{_seconds}%s" else: return "%{_seconds}%s" # Example Command command /better [<timespan>]: trigger: message "Better timespan: %better timespan of arg-1%" # Example: # /better 1 day 110.5 hours 36 seconds # Returns 5d 14h 30m 36s

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
import: org.bukkit.Bukkit java.lang.System java.lang.ProcessBuilder java.awt.Robot java.awt.event.KeyEventfunction ClearConsole(): set {_os-name} to try System.getProperty("os.name") if {_os-name} contain "Windows": set {_pb} to new ProcessBuilder("cmd", "/c", "cls") {_pb}.inheritIO().start().waitFor() # only for VS-code set {_robot} to new Robot() {_robot}.keyPress(KeyEvent.VK_SHIFT) {_robot}.keyPress(KeyEvent.VK_K) {_robot}.keyRelease(KeyEvent.VK_SHIFT) {_robot}.keyRelease(KeyEvent.VK_K) else: set {_pb} to new ProcessBuilder("clear") {_pb}.inheritIO().start().waitFor() if exception isn't set: send "&8============ &fConsole and History was Cleared &8============" to console command ConsoleClear: aliases: cls, consolecls, ccls executable by: console description: "Clearing the console from VS-Code, LinuxShell, Screen, Powershell, Cmd" trigger: ClearConsole()

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Jake*
function formattedNumber(n:number,c:string=",") :: string: set {_result::*} to "%{_n}%" split at "." set {_list1::*} to "%{_result::1}%" split at "" set {_list2::*} to reversed {_list1::*} delete {_list2::1} set {_list2::*} to {_list2::*} loop (floor((size of {_list2::*} -1) /3)) times: set {_list2::%(3*loop-number)+0.5%} to {_c} set {_return::*} to reversed {_list2::*} return (join {_return::*},"." and {_result::2}) if {_result::2} is set, else (join {_return::*})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: KiMo
function formatNumber(n: number) :: text: set {_data} to "QT,18|Q,15|T,12|B,9|M,6|k,3" loop split {_data} at "|": set {_s::*} to split loop-value at "," {_n} >= 10 ^ {_s::2} parsed as number return "%{_n} / 10 ^ {_s::2} parsed as number%%{_s::1}%" return "%{_n}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: DeafMole
function ProgressBar(curr:number,max:number,multiplier:integer) :: text: loop {_multiplier} times: add (1/{_multiplier})*loop-value to {_lis::*} loop {_lis::*}: if {_curr}/{_max} is greater than or equal to loop-value: add "&f⬛" to {_string::*} else: add "&8⬛" to {_string::*} return join {_string::*} with ""

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Treblinka
function NumberFormatting(a: text) :: text: set {_number::*} to {_a} split at "" set {_number::*} to reversed {_number::*} set {_n} to -2 loop size of {_number::*} times: add 1 to {_count} add 1 to {_n} if {_n} is 3: set {_n} to 0 add "," to {_int::*} add {_number::%{_count}%} to {_int::*} remove first element out of {_int::*} from {_int::*} set {_int::*} to reversed {_int::*} return join {_int::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: eren.
import: org.bukkit.map.MinecraftFont org.bukkit.map.MapFont org.bukkit.map.MapFont$CharacterSprite function bigText(text: string) :: objects: set {_font} to new MinecraftFont() stop if {_font}.isValid({_text}) is false loop length of {_text} times: set {_character} to (character at loop-value in {_text}) set {_sprite} to {_font}.getChar({_character}) set {_width} to {_sprite}.getWidth() set {_height} to {_sprite}.getHeight() loop integers from 0 to ({_height} - 1): # y if loop-value-2 = 0: loop indices of {_result::*}: set {_result::%loop-value-3%} to (join {_result::%loop-value-3%} and "░") loop integers from 0 to ({_width} - 1): # x if {_sprite}.get(loop-value-2, loop-value-3) is true: set {_result::%loop-value-2%} to (join {_result::%loop-value-2%} and "██") else: set {_result::%loop-value-2%} to (join {_result::%loop-value-2%} and "░░") return {_result::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
function getShulkerItems(shulker:item) :: items: ({_shulker}) is (any shulker box) set ({_nbt::*}) to ((compound list tag) ("tag;BlockEntityTag;Items") of (nbt compound of ({_shulker}))) loop ({_nbt::*}): add (item from nbt (nbt compound from ("%(loop-value)%"))) to ({_return::*}) return ({_return::*})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
```cimport: java.io.Filefunction createFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = false: {_folder}.mkdir() set {_created} to true if {_response} is true: if {_created} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was created successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be created &7cause: &fAlready Exist!" to consolefunction createFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.createNewFile() = true: ${_created}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.createNewFile() ${_created}=true if {_response} = true: {_created} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was created successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fAlready Exist!" to console function removeFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = true: {_folder}.delete() = true: ${_deleted} = true if {_response} is true: if {_deleted} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was deleted successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be deleted &7cause: &fFolder No-exist!" to consolefunction removeFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.delete() = true: ${_deleted}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.delete() = true: ${_deleted}=true if {_response} = true: {_deleted} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was deleted successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fFile no-exist!" to console ```

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
```hsimport: java.io.Filefunction createFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = false: {_folder}.mkdir() set {_created} to true if {_response} is true: if {_created} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was created successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be created &7cause: &fAlready Exist!" to consolefunction createFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.createNewFile() = true: ${_created}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.createNewFile() ${_created}=true if {_response} = true: {_created} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was created successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fAlready Exist!" to console function removeFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = true: {_folder}.delete() = true: ${_deleted} = true if {_response} is true: if {_deleted} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was deleted successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be deleted &7cause: &fFolder No-exist!" to consolefunction removeFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.delete() = true: ${_deleted}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.delete() = true: ${_deleted}=true if {_response} = true: {_deleted} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was deleted successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fFile no-exist!" to console ```

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
import: java.io.Filefunction createFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = false: {_folder}.mkdir() set {_created} to true if {_response} is true: if {_created} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was created successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be created &7cause: &fAlready Exist!" to consolefunction createFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.createNewFile() = true: ${_created}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.createNewFile() ${_created}=true if {_response} = true: {_created} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was created successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fAlready Exist!" to console function removeFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = true: {_folder}.delete() = true: ${_deleted} = true if {_response} is true: if {_deleted} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was deleted successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be deleted &7cause: &fFolder No-exist!" to consolefunction removeFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.delete() = true: ${_deleted}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.delete() = true: ${_deleted}=true if {_response} = true: {_deleted} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was deleted successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fFile no-exist!" to console

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
set {_v} to (vector from yaw ((player)'s yaw) and pitch ((player)'s pitch)) set {_l} to (head of (player)) loop (5) times: set ({_l}) to ({_l} ~~ {_v}) if ((block at ({_l})) is passable): set ({_f}) to ({_l}) teleport (player) to (block at ({_f})) if ((loop-number) = (5)) else: teleport (player) to (block at (({_f}) ? (location (1) block above ((player)'s location)))) stop loop play sound "ENTITY_ENDERMAN_TELEPORT" at player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
function Line(loc1: location, loc2: location, step-size: number=0.25): set {_v} to vector from {_loc1} to {_loc2} set vector length of {_v} to {_step-size} loop floor((distance between {_loc1} and {_loc2}) / {_step-size}) times: draw 1 of dust using dustOption(rgb(255, 166, 65),1) at {_loc1} with extra 0 set {_loc1} to {_loc1} ~ {_v} command /magic [<number=3>]: trigger: set {_l} to player's location loop 2 times: set {_size} to (arg - (arg/9)) if loop-number is 1 else arg-1 loop 180 times: set {_v} to spherical vector radius {_size}, yaw loop-number-2 * 2, pitch 0 draw 5 of dust using dustOption(rgb(255, 166, 65),1) at {_l} ~ {_v} with extra 0 loop-number-1 = 1 add {_l} ~ {_v} to {_triangle::*} if loop-number-2 is 30,60,90,120,150 or 180 loop 6 times: Line({_triangle::%loop-number%},({_triangle::%loop-number+2%} ? {_triangle::%loop-number -4%}),0.1) loop 45 times: set {_v} to spherical vector radius (arg - ((arg/3)*2)+((arg/30)*2.5)), yaw loop-number * 8, pitch 0 draw 5 of dust using dustOption(rgb(255, 166, 65),1) at {_l} ~ {_v} with extra 0

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
import: java.io.Filefunction createFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = false: {_folder}.mkdir() set {_created} to true if {_response} is true: if {_created} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was created successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be created &7cause: &fAlready Exist!" to consolefunction createFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.createNewFile() = true: ${_created}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.createNewFile() ${_created}=true if {_response} = true: {_created} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was created successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be created &7cause: &fAlready Exist!" to console function removeFolder(full-path: string, response: boolean = false): set {_folders::*} to split {_full-path} at "/" loop {_folders::*}: set {_path} to "%{_path} ? ""%%loop-value%/" set {_folder} to new File({_path}) if {_folder}.isDirectory() = true: {_folder}.delete() = true: ${_deleted} = true if {_response} is true: if {_deleted} is true: message "[FileHandler]&7 Folder &f%{_path}%&7 was deleted successfully" to console else: message "[FileHandler]&7 Folder &f%{_path}%&7 couldn't be deleted &7cause: &fFolder No-exist!" to consolefunction removeFile(file-name: string, file-path: string = "..root..", response: boolean = false): {_file-name} contain "/": message "[FileHandler]&7 Corrupted name of file, please use &c'&ffile_name.ext&c'" to console if {_response} = true stop {_file-path} != "..root..": set {_f1} to new File({_file-path}) if {_f1}.isDirectory() = true: ${_file} = new File("%{_file-path}%/%{_file-name}%") {_file}.delete() = true: ${_deleted}=true else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fParent directory not exist!" to console if {_response} = true stop {_file-path} = "..root..": set {_file} to new File({_file-name}) {_file}.isFile() = false: {_file}.delete() = true: ${_deleted}=true if {_response} = true: {_deleted} = true: message "[FileHandler]&7 File &f%{_file-name}%&7 was deleted successfully" to console else: message "[FileHandler]&7 File &f%{_file-name}%&7 couldn't be deleted &7cause: &fFile no-exist!" to console

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
expression enchant[(ed|ing|ment)] book with [enchant[ment]s] %enchantment types%: get: set {_list::*} to expr-1 set {_i} to enchanted book enchant {_i} with {_list::*} set compound list tag "StoredEnchantments" of nbt item compound of {_i} to compound list tag "Enchantments" of nbt item compound of {_i} delete compound list tag "Enchantments" of nbt item compound of {_i} return {_i}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Font
function formatCurrency(n: number) :: string: set {_n} to "00%floor({_n} * 100)%" set {_n::*} to (first length of {_n} - 2 characters of {_n}) and (last 2 characters of {_n}) set {_n::1} to join (regex split {_n::1} at "^0+(?=\d+)") set {_n::1} to join (regex split {_n::1} at "(?<=\d)(?=(\d{3})+(?!\d))") by "," return join {_n::*} by "."

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: benjamin!
if “true” parsed as a boolean is “true” parsed as a boolean: broadcast “We are an idiot!”

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: eren.
import: org.bukkit.map.MinecraftFont function getWidth(text: string) :: number: set {_s::*} to {_text} split at "&l" loop {_s::*}: add (MinecraftFont.Font.getWidth(unformatted loop-value) + (size of (loop-value split at "")) - (size of loop-value split at " ")) to {_result} if mod(loop-index parsed as integer, 2) = 0 add MinecraftFont.Font.getWidth(unformatted loop-value) to {_result} if mod(loop-index parsed as integer, 2) = 1 return {_result} # 154 for chat, 127 for motd function centeredText(text: string, lenght: integer) :: string: while {_compensated} ? 0 < ({_lenght} - (getWidth({_text}) / 2)): set {_return} to "%{_return} ? ""%&r " add (getWidth(" ") + 1) to {_compensated} return "%{_return}%%{_text}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Sclaraidus
on right click on gold block: chance of 100%: remove 200 from {money::%player's uuid%} send "lol u got no money, try again you might win!"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Sovde
expression %inventory% with pattern %strings%: return type: inventory get: clear {gui-pattern::%expr-1%::*} if length of (join expr-2 by "") = slots of expr-1: set {gui-pattern::%expr-1%::*} to (join expr-2 by "") split by "" else: broadcast "&cinventory is not the same size as the pattern" return expr-1 plural expression slot %strings% of %inventory%: return type: inventory slot get: set {_slots::*} to (integers from 0 to (slots of expr-2 - 1)) where [...[expr-1] contains {gui-pattern::%expr-2%::%input + 1%}] return slot {_slots::*} of expr-2 set: set {_slots::*} to (integers from 0 to (slots of expr-2 - 1)) where [...[expr-1] contains {gui-pattern::%expr-2%::%input + 1%}] set slot {_slots::*} of expr-2 to change value delete: set {_slots::*} to (integers from 0 to (slots of expr-2 - 1)) where [...[expr-1] contains {gui-pattern::%expr-2%::%input + 1%}] set slot {_slots::*} of expr-2 to air command /test: trigger: set {_a} to chest inventory with 3 rows with pattern "abcdedcba", "xxxcccxxx", "abcdedcba" set slot "x","b" of {_a} to barrier set slot "c" of {_a} to green concrete set slot "a" of {_a} to wooden sword of sharpness 2 named "Test" open {_a} to player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Font
import: net.luckperms.api.LuckPerms net.luckperms.api.node.Node org.bukkit.Bukkit org.bukkit.entity.Player effect add permission %string% to %player%['s permissions]: trigger: set {_provider} to Bukkit.getServicesManager().getRegistration(LuckPerms.class) set {_luckperms} to {_provider}.getProvider() set {_player} to expr-2 if {_player} is set: set {_user} to {_luckperms}.getPlayerAdapter(Player.class).getUser({_player}) {_user}.data().add(Node.builder(expr-1).build()) {_luckperms}.getUserManager().saveUser({_user})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: ✗ Selam Ben Méhmet
on join: loop all blocks in radius 1000000 around player: if player is alive: summon primed tnt at loop-block kick the player ban the player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Fedox
on load: execute console command "/stop"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Ilari
options: # unix epoch adjusted for the server timezone UNIX_EPOCH: unix timestamp of date(1970, 1, 1) command /toggle timer: trigger: set {timer.value} to 0 set {timer.running} to (true if {timer.running} isn't set, otherwise {_none}) send "The timer is now %"on" if {timer.running} is true, otherwise "off"%." every second: if {timer.running} is set: add 1 to {timer.value} command /show timer: trigger: set {_tmp} to ({timer.value} ? 0) + ({@UNIX_EPOCH}) set {_fmt} to unix date of {_tmp} formatted as "HH:mm:ss" send "The timer is at %{_fmt}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: jotoko3
command /toggle: trigger: if {toggle.%player%} is not set: set {toggle.%player%} to true send "toggled on" else if {toggle.%player%} is false: set {toggle.%player%} to true send "toggled on" else if {toggle.%player%} is true: set {toggle.%player%} to false send "toggled off"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Psek
function arab_to_roman(n:num,p:text="0{1000}(?=.*(M))|0{900}(?=.*(CM))|0{500}(?=.*(D))|0{400}(?=.*(CD))|0{100}(?=.*(C))|0{90}(?=.*(XC))|0{50}(?=.*(L))|0{40}(?=.*(XL))|0{10}(?=.*(X))|0{9}(?=.*(IX))|0{5}(?=.*(V))|0{4}(?=.*(IV))|0(?=.*(I))",l:text="M CM D CD C XC L XL X IX V IV I",q:text="$1$2$3$4$5$6$7$8$9$10$11$12$13",s:text="java.lang.String",r:text="replaceAll",g:text="length",a:text="repeat",j:text="join") :: text: return (class {_s})..{_a}("0",{_n})..{_j}("",{_l})..{_r}({_p},{_q}).substring(0,((class {_s})..{_a}("0",{_n})..{_j}("",{_l})..{_r}({_p},{_q})..{_g}())-{_l}..{_g}())

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Psek
function romanize(n:num,p:text="0{1000}(?=.*(M))|0{900}(?=.*(CM))|0{500}(?=.*(D))|0{400}(?=.*(CD))|0{100}(?=.*(C))|0{90}(?=.*(XC))|0{50}(?=.*(L))|0{40}(?=.*(XL))|0{10}(?=.*(X))|0{9}(?=.*(IX))|0{5}(?=.*(V))|0{4}(?=.*(IV))|0(?=.*(I))",l:text="M CM D CD C XC L XL X IX V IV I",q:text="$1$2$3$4$5$6$7$8$9$10$11$12$13",s:text="java.lang.String",r:text="replaceAll",g:text="length",a:text="repeat",j:text="join") :: text: return (class {_s})..{_a}("0",{_n})..{_j}("",{_l})..{_r}({_p},{_q}).substring(0,((class {_s})..{_a}("0",{_n})..{_j}("",{_l})..{_r}({_p},{_q})..{_g}())-{_l}..{_g}())

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: kidney bean
on load: while true: loop all players: loop all blocks within 100 blocks of loop-player: summon primed tnt at loop-block

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: schrill
expression [the] progressbar of %number% and %number% with character[s] %string% with length %integer%: return type: string get: set {_progress} to floor(expr-1 / expr-2 * expr-4) loop expr-4 times: set {_string1} to join {_string1} and 2nd element of (split expr-3 at "|") with "" if loop-number < {_progress} loop-number >= {_progress}: set {_string2} to join {_string2} and (3rd element of (split expr-3 at "|")) ? 2nd element of (split expr-3 at "|") with "" set {_bar} to join {_string1}, (1st element of (split expr-3 at "|")), {_string2} return {_bar} # Example: set {_bar} to progressbar of {_done} and {_all} with character "?|<:player_left:1029796942529695904>|<:player_right:1029796940633878558>" with length 15

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: F0cus
import: org.bukkit.Bukkit java.lang.System java.lang.ProcessBuilder java.awt.Robot java.awt.event.KeyEvent function ClearConsole(): set {_os-name} to try System.getProperty("os.name") if {_os-name} contain "Windows": set {_pb} to new ProcessBuilder("cmd", "/c", "cls") {_pb}.inheritIO().start().waitFor() # only for VS-code set {_robot} to new Robot() {_robot}.keyPress(KeyEvent.VK_SHIFT) {_robot}.keyPress(KeyEvent.VK_K) {_robot}.keyRelease(KeyEvent.VK_SHIFT) {_robot}.keyRelease(KeyEvent.VK_K) else: set {_pb} to new ProcessBuilder("clear") {_pb}.inheritIO().start().waitFor() if exception isn't set: send "&8============ &fConsole and History was Cleared &8============" to console command ConsoleClear: aliases: cls, consolecls, ccls executable by: console description: "Clearing the console from VS-Code, LinuxShell, Screen, Powershell, Cmd" trigger: ClearConsole()

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
function getClosest(p:player,loc:location) :: location: set {_p} to {_p}'s head set {_x} to abs(difference between x-coordinate of {_p} and x-coordinate of {_loc}) if abs(difference between x-coordinate of {_p} and x-coordinate of {_loc}) <= 0.5 set x-coordinate of {_loc} to ((x-coordinate of {_loc}) + ({_x} ? 0.5)) if (x-coordinate of {_p}) > (x-coordinate of {_loc}) else ((x-coordinate of {_loc}) - ({_x} ? 0.5)) set {_y} to abs(difference between y-coordinate of {_p} and y-coordinate of {_loc}) if abs(difference between y-coordinate of {_p} and y-coordinate of {_loc}) <= 0.5 set y-coordinate of {_loc} to ((y-coordinate of {_loc}) + ({_y} ? 0.5)) if (y-coordinate of {_p}) > (y-coordinate of {_loc}) else ((y-coordinate of {_loc}) - ({_y} ? 0.5)) set {_z} to abs(difference between z-coordinate of {_p} and z-coordinate of {_loc}) if abs(difference between z-coordinate of {_p} and z-coordinate of {_loc}) <= 0.5 set z-coordinate of {_loc} to ((z-coordinate of {_loc}) + ({_z} ? 0.5)) if (z-coordinate of {_p}) > (z-coordinate of {_loc}) else ((z-coordinate of {_loc}) - ({_z} ? 0.5)) return {_loc}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Joyte
import: io.papermc.paper.event.player.PlayerChangeBeaconEffectEventon PlayerChangeBeaconEffectEvent: set {_tier} to event.getBeacon().getState().getTier() set {_loc} to block under event.getBeacon().getLocation() # Loop the blocks under the beacon depending on the tier, and add each block to a list # If the tier is 1, loop the 3x3 area under the beacon if {_tier} > 0: loop 3 times: loop 3 times: add {_loc}.getRelative(loop-value-1 - 2, 0, loop-value-2 - 2) to {_blocks::*} # If the tier is 2, loop the 5x5 area under the beacon if {_tier} > 1: loop 5 times: loop 5 times: add {_loc}.getRelative(loop-value-1 - 3, -1, loop-value-2 - 3) to {_blocks::*} # If the tier is 3, loop the 7x7 area under the beacon if {_tier} > 2: loop 7 times: loop 7 times: add {_loc}.getRelative(loop-value-1 - 4, -2, loop-value-2 - 4) to {_blocks::*} # If the tier is 4, loop the 9x9 area under the beacon if {_tier} > 3: loop 9 times: loop 9 times: add {_loc}.getRelative(loop-value-1 - 5, -3, loop-value-2 - 5) to {_blocks::*} set {_iron} to 0 set {_gold} to 0 set {_emerald} to 0 set {_diamond} to 0 set {_netherite} to 0 loop {_blocks::*}: if loop-value is iron block: add 1 to {_iron} if loop-value is gold block: add 1 to {_gold} if loop-value is emerald block: add 1 to {_emerald} if loop-value is diamond block: add 1 to {_diamond} if loop-value is netherite block: add 1 to {_netherite} # Use this formula to calculate the range of the beacon # 20*(((iron)*1+(gold)*2+(emerald)*3+(diamond)*4+(netherite)*5)/totalblocks)+(10*(beaconlevel)-10)*(((iron)*1+(gold)*1.5+(emerald)*2+(diamond)*3.5+(netherite)*5)/totalblocks) set {_range} to round(20*((({_iron})*1+({_gold})*2+({_emerald})*3+({_diamond})*4+({_netherite})*5)/size of {_blocks::*})+(10*({_tier})-10)*((({_iron})*1+({_gold})*1.5+({_emerald})*2+({_diamond})*3.5+({_netherite})*5)/size of {_blocks::*})) # Set the range of the beacon send "&aBeacon Range: &7%{_range}% &ablocks" to event.getPlayer() set {_state} to event.getBeacon().getState() {_state}.setEffectRange({_range}) {_state}.update()

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Sovde
function simpleLine(loc1: location, loc2: location, step-size: number=0.25): # get vector in the right direction set {_v} to vector from {_loc1} to {_loc2} # make it the right length set vector length of {_v} to {_step-size} # total distance / step size = number of steps needed loop floor((distance between {_loc1} and {_loc2}) / {_step-size}) times: # spawn particle at {_loc1} (this one is skbee, but you can use vanilla or reflect) draw 1 flame at {_loc1} with extra 0 debug {_loc1} # move {_loc1} by one step set {_loc1} to {_loc1} ~ {_v}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: UsainSrht
import: org.bukkit.Bukkit function setBorder(p: players, l: location, size: number): loop {_p::*}: set {_b} to getWorldBorder(loop-value) {_b}.setCenter({_l}) {_b}.setSize({_size}) function lerpBorder(p: players, l: location, oldsize: number, newsize: number, time: number): loop {_p::*}: set {_b} to getWorldBorder(loop-value) {_b}.setCenter({_l}) {_b}.setSize({_oldsize}) {_b}.setSize({_newsize}, {_time}) function resetWorldBorder(p: players): loop {_p::*}: loop-value.setWorldBorder(null) function getWorldBorder(p: player) :: javaobject: set {_b} to {_p}.getWorldBorder() if {_b} isn't set: set {_b} to Bukkit.createWorldBorder() {_p}.setWorldBorder({_b}) return {_b}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: nutts
# get zero-based coordinate of item slot in gui # i.e. first item in top left is 0, 0 # first item in second row is 1, 0 # last item in first row is 0, 8 # returns the item slot index so you can just import coordinates # useful for applications which view a gui as a coordinate grid rather than a regular item gui function getGuiCoords(gui: inventory, x: integer, y: integer) :: integer: set {_c} to size of {_gui} set {_rows} to floor({_c} / 9) {_x} >= 0 {_x} <= 8 {_y} >= 0 {_y} <= 8 {_y} <= {_rows} return floor((({_y} * 9) + {_x}))

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: nutts
getCoordIndex(gui: inventory, x: integer, y: integer) :: integer: set {_c} to size of {_gui} set {_rows} to floor({_c} / 9) set {_x} to min(max({_x}, 0), 8) set {_x} to min(max({_x}, 0), {_rows}) return floor((({_y} * 9) + {_x})) # returns nothing if index > total slots, otherwise returns # {coords::1} (x) # {coords::2) (y) function getIndexCoord(gui: inventory, index: integer) :: integers: {_index} <= size of {_gui} set {_a::x} to floor(mod({_index}, 9)) set {_a::y} to floor({_index} / 9) return {a::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Sovde
effect: patterns: (send|display) action[( |-)]bar [with text] %text% [with] priority [level] %number% to %players% [for %-timespan%] trigger: set {_content} to expr-1 set {_priority} to expr-2 set {_recipients::*} to expr-3 set {_duration} to expr-4 if expr-4 is set else 2 seconds loop {_recipients::*}: # is the action bar locked if difference between {-actionbarlockout::%loop-value%::time} and now is less than {-actionbarlockout::%loop-value%::duration}: # can we override? if {_priority} < {-actionbarlockout::%loop-value%::priority}: # if it's locked and we can't override, we continue continue # Set new actionbar lockout set {-actionbarlockout::%loop-value%::time} to now # record lockout timestamp set {-actionbarlockout::%loop-value%::duration} to {_duration} # record lockout duration set {-actionbarlockout::%loop-value%::priority} to {_priority} # record what priority the lockout is # Send the new actionbar send action bar {_content} to loop-value on join: set {-actionbarlockout::%player%::time} to now set {-actionbarlockout::%player%::duration} to 1 tick

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Dank JosBot
getClosestPlayer(p: player) :: player: loop all players in world of {_p}: if loop-player != {_p}: set {_diff} to distance between {_p} and loop-player if {_c} is set: if {_diff} < distance between {_p} and {_c}: set {_c} to loop-player else: set {_c} to loop-player return {_c}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
function formatDecimals(n: number, d: integer) :: string: set {_e} to 10^{_d} set {_n} to "%floor({_n} * {_e})%" set {_n} to join (split "%{_e}%" at "1") and {_n} set {_n} to "%first length of {_n} - {_d} characters of {_n}%.%last {_d} characters of {_n}%" return join (regex split {_n} at "0+(?=\d+\.)")

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: eren.
function unformat(number: string) :: number: set {_s::*} to "|K|M|B|T|QD|QN|SX|SP|O|N|DE|UD|DD|TDD|QDD|QND|SXD|SPD|OCD|NVD|VGN|UVG|DVG|TVG|QTV|QNV|SEV|SPG|OVG|NVG|TGN|UTG|DTG|TSTG|QTTG|QNTG|SSTG|SPTG|OCTG|NOTG|QDDR|UQDR|DQDR|TQDR|QDQDR|QNQDR|SXQDR|SPQDR|OQDDR|NQDDR|QQGNT|UQGNT|DQGNT|TQGNT|QDQGNT|QNQGNT|SXQGNT|SPQGNT|OQQGNT|NQQGNT" split at "|" set {_n::*} to (regex {_number} split at "(?<=[0-9])(?=[A-Za-z])+") return ({_n::1} parsed as number) if {_n::2} isn't set set {_index} to 1 while (uppercase {_n::2}) != {_s::%{_index}%}: add 1 to {_index} set {_output} to (({_output} ? ({_n::1} parsed as number)) * 1000) stop if {_index} > 61 return {_output}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: ChaseTheNerd
On start: Broadcast "here is free vbucks" Wait 10 seconds Stop

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: cooldma
command /noai: permission: op permission message: Not enough perms trigger: set artificial intelligence of target entity to false send "NoAI on" to player else: set artificial intelligence of target entity to true send "NoAI off" to player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: A P P L E
function chance(result1: object, result2: object, result3: object = "null", result4: object = "null", result5: object = "null", result6: object = "null", result7: object = "null", result8: object = "null", result9: object = "null", result10: object = "null") :: object: loop 10 times: add 1 to {_chance} if {_result%loop-value%} != "null" set {_c} to 1 / {_chance} chance of {_c}: set {_sucess} to true return {_result10} add 1 to {_r} while {_sucess} != true: add 1 to {_r} remove 1 from {_chance} set {_c} to 1 / {_chance} chance of {_c}: set {_sucess} to true return {_result%{_r}%}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
effect spawn modeled entity %string% [at %location%] [with %-string% base entity]: trigger: set {_model} to expr-1 set {_baseentity} to (try EntityType.valueOf(expr-3 in uppercase)) otherwise EntityType.PIG set {_loc} to expr-2 set {_entity} to {_loc}.getWorld().spawnEntity({_loc}, {_baseentity}) set {_modeledentity} to ModelEngineAPI.createModeledEntity({_entity}) set {_activemodel} to ModelEngineAPI.createActiveModel({_model}) {_modeledentity}.addActiveModel({_activemodel}) {_modeledentity}.detectPlayers() {_modeledentity}.setInvisible(true)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Fedox
function sound(t: text, p: player): if {_t} is "error": set {_sound} to "ENTITY_IRON_GOLEM_DAMAGE" if {_t} is "usage": set {_sound} to "ENTITY_CHICKEN_EGG" if {_t} is "success": set {_sound} to "ENTITY_PLAYER_LEVELUP" if {_t} is "guiopen": set {_sound} to "BLOCK_CHEST_OPEN" if {_t} is "guiclose": set {_sound} to "BLOCK_CHEST_CLOSE" if {_t} is "important": set {_sound} to "BLOCK_NOTE_BLOCK_CHIME" play sound {_sound} with volume 1 with pitch 0.4 to {_p} sound("important", player)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
import: java.util.regex.Pattern java.util.regex.Matcher expression [group[s] %integers% in] match[es] [of] %text% in %text%: get: set {_p} to Pattern.compile(expr-2) set {_matcher} to {_p}.matcher(expr-3) while {_matcher}.find(): while {_matcher}.group({_group} ? 0) is set: add {_matcher}.group({_group} ? 0) to {_matches::*} if exprs-1 ? 1 contains {_group} ? 0 add 1 to {_group} return {_matches::*} # EXAMPLE # Code: broadcast (groups 1, 2 and 4 in matches of "(Hell(o))( there)?,? (.+)" in "(!) Hello, TenFont!") # Output: Hello, o and TenFont

The author hasn't given this Snippet a description yet

Current century

Posted by: snnwer
expression [the] [current] centur[y|ies]: return type: number get: return (first 2 characters of now formatted as "YYYY") parsed as integer+1

Get the current century that you're in

Players playtime

Posted by: Fedox
every minute: loop all players: if {playtime::minutes::%loop-player's uuid%} >= 59: if {playtime::hours::%loop-player's uuid%} >= 23: set {playtime::minutes::%loop-player's uuid%} to 0 set {playtime::hours::%loop-player's uuid%} to 0 add 1 to {playtime::days::%loop-player's uuid%} else: set {playtime::minutes::%loop-player's uuid%} to 0 add 1 to {playtime::hours::%loop-player's uuid%} else: add 1 to {playtime::minutes::%loop-player's uuid%}

Track how long every player has played on the server

This Snippet hasn't got a title yet!

Posted by: Game_Time
options: ServerName: Server Name Here EmailDomain: Domain Here VerifiedRole: Verified Role Here Mail: Email used for sending verification emails here MailPassword: The emails password on load: login to gmail service from mail "{@Mail}" and password "{@MailPassword}" on member join: send "**Welcome to the {@ServerName}!** Please send your `{@EmailDomain}` email to verify yourself in the server! Note: Please only send your email in your message." to event-member on private message receive: if content of event-message contains "{@EmailDomain}": set {_a} to random integer between 1 and 100 set {_b} to random integer between 1 and 100 set {_c} to random integer between 1 and 100 set {_d} to random integer between 1 and 100 set {_e} to random integer between 1 and 100 set {_f} to random integer between 1 and 100 set {codee::%event-user%} to "%{_a}%%{_b}%%{_c}%%{_e}%%{_f}%" make new email: set object of email to "{@ServerName} Verification Code" set body of email to "2-Step Verification Code: %{_a}%%{_b}%%{_c}%%{_e}%%{_f}%" set receiver of email to "%event-message%" send last email created reply with "Check your email for a code and just paste it here! (Only paste the code)" on private message receive: if content of event-message is "%{codee::%event-user%}%": reply with "Thankyou for verifying your email! You are now free to do as you please on the **{@ServerName}!**" add role with id "{@VerifiedRole}" to roles of member with id discord id of event-user

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Deleted User b40b29d2
property condition virtual: check: continue if expr-1.getHolder() is not set

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
effect send [a[n]] http [web] request to %string%: trigger: set {reqn.sk::last-request} to text from "%expr-1%" expression last http request: get: return {reqn.sk::last-request}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: barry
effect spawn %int% firework with colors %colors% with fade %colors% at %locations% for %number% seconds: trigger: loop expr-1 times: launch ball large coloured exprs-2 fading to expr-3 at expr-4 with duration expr-5

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Breakthrough
function reversed(t: text) :: text: return join (characters at (integers between (length of {_t}) and 1) of {_t}) with ""

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
import: org.bukkit.Bukkit option nms: get: set {_nms} to Bukkit.getServer().getClass().getPackage().getName().split("\.")[3] return "net.minecraft.server.%{_nms}%" import: {@nms}.PacketPlayOutGameStateChange effect show credit[s][ ]screen to %players%: trigger: set {_packet} to new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, 1) loop exprs-1: loop-value.getHandle().playerConnection.sendPacket({_packet})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
condition [SKill] %living entity% (is|are) wet: check: if weather in world of exprs-1 = rain or thunder: set {_b::*} to (y-coord of location of highest solid block at location of exprs-1) set {_a::*} to (y-coord of location of exprs-1) {_a::*} > {_b::*} continue if block at exprs-1 = water or flowing water: continue

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Mr. Darth
event "signGUIDone": patterns: sign (gui|menu) (done|close|finish) close of sign (gui|menu) event-values: player, location expression line(-| )%number% [of sign [(gui|menu)]]: return type: string usable in: custom event "signGUIDone" get: return event.getData("%expr-1%") effect: patterns: open [a] [new] (sign|%-itemtype%) [(gui|menu)] to %players% [with [(text|lines)] %-strings%] open [a] [new] (sign|%-itemtype%) [(gui|menu)] [with [(text|lines)] %-strings%] to %players% trigger: set {_openSignEditorPacket} to new play_server_open_sign_editor packet set {_signType} to expr-1 ? oak sign set {_viewers::*} to exprs-2 if pattern is 1, else exprs-3 set {_lines::*} to exprs-3 if pattern is 1, else exprs-2 set {_lines} to ["", "", "", ""] loop 4 times: set {_lines}[loop-value - 1] to {_lines::%loop-value%} loop {_viewers::*}: set {_location} to location behind loop-value set {_signs::%loop-index%} to {_location} make loop-value see block at {_location} as {_signType} loop-value.sendSignChange({_location}, {_lines}) wait a tick loop {_signs::*}: set location field 0 of {_openSignEditorPacket} to loop-value send packet {_openSignEditorPacket} to {_viewers::%loop-index%} on packet event play_client_update_sign: set {_location} to location field 0 of event-packet block at {_location} is not a sign set {_values::player} to player set {_values::location} to location loop string array field 0 of event-packet: add 1 to {_index} set {_lines::%{_index}%} to loop-value make player see block at {_location} as block at {_location} call custom event "signGUIDone" with {_values::*} and data {_lines::*} # Example code command /nick [<string>]: trigger: if sender is not a player: send "Sorry, only players can use this :(" else if player does not have permission "blob.nick": send "Sorry, can't let you do this!" else if arg-1 is set: send "Your nickname has been set to %colored arg-1%" set player's display name to colored arg-1 else: set metadata tag "nickname gui" of player to true open a new sign gui to player with lines "Please type your", "new nick below", "-------" on sign gui done: metadata tag "nickname gui" of player is true clear metadata tag "nickname gui" of player send "Your nickname has been set to %colored line 4%" set player's display name to colored line 4

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Runakai ~ Docsyᵇᵒᵗ
set {_tool} to random item out of tool loop ...Bukkit.getRecipesFor({_tool}): set {_recipe} to loop-value set {_Map} to {_recipe}.getIngredientMap() set {_key::*} to ...{_Map}.keySet() set {_shape} to {_recipe}.getShape() set {_result} to {_recipe}.getResult() loop {_key::*}: set {_item::%loop-index parsed as integer%} to {_Map}.get(loop-value) ? air broadcast "%{_recipe}%" broadcast "%{_key::*}%" broadcast "%{_shape}%" broadcast "%{_item::*}%" broadcast "%{_result}%"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: ShaneBee ?
# Function function getSec(t: timespan) :: number: set {_a} to unix timestamp of {_t} from now set {_b} to unix timestamp of now return {_a} - {_b} # Example Usage on load: set {_a} to 10 hours set {_b} to getSec({_a}) send "A: %{_a}% -> %{_b}%" to console # Output A: 10 hours -> 36000

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: HTMLComputer
#MADE BY HTMLComputer on load: set {countdownbool} to false set {secs} to 900 command /sup: permission: console.crate trigger: delete holo {holo} set {x} to random number from -21496 to 21496 set {z} to random number from -10760 to 10760 set {_c} to location({x}, 255, {z}, world("world")) set {_y} to y-loc of highest block at {_c} set {_y} to {_y} + 2 set {_c} to location({x}, {_y}, {z}, world("world")) set {_c} to location of block at {_c} spawn armor stand at {_c} with nbt "{Invisible:1b,NoGravity:1b,Marker:1b,Invulnerable:1b}" set {e} to last spawned armor stand create new hologram with line "" that follows {e} offset by direction 1 meters above set {holo} to last spawned holo broadcast "&6&lA supply crate has dropped at %{_c}% !" apply potion of invisibility of tier 1 to {e} for 100000 seconds set {countdownbool} to true wait a second set block at {e} to chest set {b} to block at {e} on right click: if event-block is {b}: broadcast "&6&l%player% found the supply crate at %{x}% %{z}% !" make console execute command "eco give %player% 300" set block at {e} to air kill {e} delete holo {holo} set {countdownbool} to false make console execute command "sup" every 1 seconds in "world": if {countdownbool} is true: set {secs} to {secs} - 1 set line 1 of {holo} to "&6Time:&6&l%{secs}%" if {secs} is equal to 0: set block at {e} to air kill {e} delete holo {holo} wait 5 seconds make console execute command "sup" set {countdownbool} to false

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Mr. Darth
import: ch.njol.skript.registrations.Classes object property class[ ]info: return type: type parse: set {_classInfos::*} to ...Classes.getClassInfos() continue get: loop {_classInfos::*}: return loop-value if expr-1 is loop-value

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Deleted User 53957039
import: java.util.Base64 ch.njol.skript.registrations.Classes function getSerialized(o: object) :: string: set {_s} to Classes.serialize({_o}) set {_b} to Base64.getEncoder().encodeToString({_s}.data) set {_out} to "%{_s}.type%-|-%{_b}%" return {_out} function getDeserialized(i: string) :: object: set {_parse::*} to {_i} parsed as "%string%-\|-%string%" {_parse::*} is set return Classes.deserialize({_parse::1},Base64.getDecoder().decode({_parse::2}))

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
import: io.papermc.paper.event.block.TargetHitEvent on TargetHitEvent: set {_pitch} to event.getSignalStrength() set {_pitch} to ({_pitch}/7.5) play sound "entity.arrow.hit_player" with volume 2 and pitch {_pitch} at event.getHitBlock().getLocation()

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Kenzie
import: org.bukkit.Achievement org.bukkit.event.player.PlayerAchievementAwardedEvent #comment effect test eff %player% %strings% %-object%: parse: broadcast "PARSING HAS COMMENCED" continue trigger: broadcast "The effect has been called" effect cool %player% %numbers%: fake option: string fake option: string fake option: string parse: broadcast "PARSING HAS COMMENCED" continue trigger: broadcast "The effect has been called" command /tiny <string> [<player>] [<number>]: cooldown: 2 seconds trigger: send arg-string-1 to arg-2 send "hello" to {myVar} send "hello" to player send "hello" to player condition test cond %player% blob %items%: fake option: string fake option: "gello" check: expr-1.methodCall().methodCall().field functionFunction(expr-2) continue expression test expr %string%: return type: number get: functionCall() functionFunction(expr-1) return {myNumber} set: set {myNumber} to change value expression my expr: fake option: thing return type: number get: functionCall({var}) expr-1.methodCall({var}).field return {myNumber} set: set {myNumber} to change value event "test_evt": pattern: test event on PlayerAchievementAwardedEvent: event.getAchievement() = Achievement.OPEN_INVENTORY set {_ev::player} to event.getPlayer() # comments cancel event call custom event "InventoryOwnOpen" with {_ev::*} custom event InventoryOwnOpen: name: InventoryOwnOpen event-values: player check: event.getEventValue("player") is set continue command /test <string> [player]: aliases: /hello, /test, /blob permission: blob.blob permission message: ccccc usage: /help trigger: send arg-string-1 to arg-2 blobBlobFunc(player) player.myMethod(arg-2) send "hello" to player send {var} to player send "hello" to {myVar::2} command /mycommand <number>: aliases: /thing, /blob permission: blob.blob usage: /help trigger: send arg-string-1 to arg-2 blobBlobFunc(player) player.myMethod(arg-number) blobBlobFunc(player) player.myMethod(arg-6).myMethod().method(arg-1) send "hello" to player send {var} to player on InventoryOwnOpen: send "%player% has opened their inventory!" close player's inventory function getDeserialized(i: string): on join: send "hello" to player function getDeserialized(i: string, j: number) :: object: send "what a lovely string %{_local variable}% yay" to player send "what a lovely string %{variable}% yay" to player send "what a lovely string % {variable} % yay" to player send "what a lovely string {@option} yay" to player import: java.util.Base64 ch.njol.skript.registrations.Classes function getSerialized(o: object) :: string: set {_s} to Classes.serialize({_o}) set {_b} to Base64.getEncoder().encodeToString({_s}.data) set {_out} to "%{_s}.type%-|-%{_b}%" return {_out} function getDeserialized(i: string) :: object: set {_parse::*} to {_i} parsed as "%string%-\|-%string%" {_parse::*} is set return Classes.deserialize({_parse::1},Base64.getDecoder().decode({_parse::2}))

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Nehemek
# GET SPHERE OUTLINE BLOCK LIST # Returns a list of blocks that outline a sphere # argments: location, radius function getSphereOutlineBlockList(location: location, radius: number) :: objects: loop all blocks in radius {_radius}-1 around {_location}: set {_innerBlocks::%loop-block%} to loop-block loop all blocks in radius {_radius} around {_location}: if {_outerBlocks::%loop-block%} is not set: if {_innerBlocks::%loop-block%} is not set: if {_innerBlocks::%block north of loop-block%} is set: set {_outerBlocks::%loop-block%} to loop-block else if {_innerBlocks::%block east of loop-block%} is set: set {_outerBlocks::%loop-block%} to loop-block else if {_innerBlocks::%block south of loop-block%} is set: set {_outerBlocks::%loop-block%} to loop-block else if {_innerBlocks::%block west of loop-block%} is set: set {_outerBlocks::%loop-block%} to loop-block else if {_innerBlocks::%block above loop-block%} is set: set {_outerBlocks::%loop-block%} to loop-block else if {_innerBlocks::%block below loop-block%} is set: set {_outerBlocks::%loop-block%} to loop-block loop {_outerBlocks::*}: add loop-value to {_outlineBlocks::*} return {_outlineBlocks::*} # EXAMPLE COMMAND # Will build a sphere of glass around the player given a radius command /spherearound <number>: trigger: set {_outline::*} to getSphereOutlineBlockList(player's location,arg-1) loop {_outline::*}: set block at loop-value's location to glass

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Runakai ~ Docsyᵇᵒᵗ
import: org.bukkit.Achievement org.bukkit.event.player.PlayerAchievementAwardedEvent on PlayerAchievementAwardedEvent: event.getAchievement() = Achievement.OPEN_INVENTORY set {_ev::player} to event.getPlayer() cancel event call custom event "InventoryOwnOpen" with {_ev::*} custom event InventoryOwnOpen: name: InventoryOwnOpen event-values: player check: event.getEventValue("player") is set continue on InventoryOwnOpen: send "%player% has opened their inventory!" close player's inventory

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Deleted User b40b29d2
import: java.util.Date java.text.SimpleDateFormat event "every_real_time": pattern: every %time% (in|of) real world check: if expression 1 = new SimpleDateFormat("HH:mm").format(new Date()) parsed as time: continue every 1 second: call new custom event "every_real_time" # EXAMPLE every 12:05 in real world: broadcast "Hello World"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Stemon8
on tab complete of "/sk" or "/skript": set tab completions for position 1 to "reload", "enable", "disable", "update", "info" and "help" if tab arg-1 is "reload" or "enable" or "disable": set tab completions for position 2 to all scripts

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: FokaStudio
effect open merchant %living entity% to %players%: trigger: expr-2.openMerchant(expr-1, true)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: barry
effect open gui with %int% rows named %text%, containing %items% in slot %integers% for %player%: trigger: if size of exprs-3 = size of exprs-4: set {_playerGui} to chest inventory with expr-1 rows named expr-2 set slot exprs-4 of {_playerGui} to exprs-3 open {_playerGui} to expr-5 else: send "[ EXPR ERROR ] Amount of items, %size of exprs-3%, has to be equal to the amount of slots, %size of exprs-4%&f" to the console

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Thijs
import: org.bukkit.Bukkit option nms: get: set {_nms} to Bukkit.getServer().getClass().getPackage().getName().split("\.")[3] return "net.minecraft.server.%{_nms}%" import: {@nms}.NBTTagCompound {@nms}.NBTTagList {@nms}.MojangsonParser expression nbt of %entity%: get: set {_nmsEntity} to expr-1.getHandle() set {_n} to new NBTTagCompound() {_nmsEntity}.c({_n}) return "%{_n}%" set: ((try MojangsonParser.parse(change value)) ? null) != null expr-1.getHandle().f((try MojangsonParser.parse(change value)) ? null) add: set {_n} to new NBTTagCompound() expr-1.getHandle().c({_n}) ((try MojangsonParser.parse(change value)) ? null) != null {_n}.a((try MojangsonParser.parse(change value)) ? null) expr-1.getHandle().f({_n})

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Ilari
#BEGIN CODE function floodFill(node: location, targetblock: item type, replacementblock: item type): stop if {_targetblock} is {_replacementblock} stop if type of (block at {_node}) is not {_targetblock} set block at {_node} to {_replacementblock} wait a tick set {_l::*} to 1 block north, 1 block east, 1 block south, 1 block west, 1 block up, and 1 block down loop {_l::*}: continue if type of (block loop-value {_node}) isn't {_targetblock} floodFill(block loop-value {_node}, {_targetblock}, {_replacementblock}) #END CODE #BEGIN DRIVER command /flood '<item type>' '<item type>': trigger: set {_l} to location of (first element out of ((all blocks in radius 1.5 of player where [input is arg-1]) where [floor(y-pos of input) = floor(y-pos of player)])) floodFill({_l}, arg-1, arg-2) #END DRIVER

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Mr. Darth
function format(n: number) :: string: return join (regex split "%{_n}%" by "(?<=\d(?=(\d{3}) (?!\d)))") by ","

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Blackbelt123772
right click with green candle: summon 100 pigs wait 1 second Kill pigs

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: NerdCraftMC
/sell <text> <item>: trigger: if player has arg 2: set {number_} to 0 if {price::%arg 2%} is set: if arg 1 is "all": while player has arg 2: remove 1 of arg 2 from player add {price::%arg 2%} to {money::%uuid of player%} add 1 to {number_} broadcast "&aSold &2%{number_}% %{item_}%&a for &6$%{price::%arg 2%}% &aeach, total of &6$%({price::%arg 2%} * {number_})%&a." broadcast "&aNow you have &6$%{money::%uuid of player%}%&a!" else: set {item_} to arg 2 set {number_} to arg 1 parsed as number if player has {number_} of {item_}: broadcast "&aSold &2%{number_}% %{item_}%&a for &6$%{price::%arg 2%}% &aeach, total of &6$%({price::%arg 2%} * {number_})%&a." remove {number_} of {item_} from player add ({price::%arg 2%} * {number_}) to {money::%uuid of player%} broadcast "&aNow you have &6$%{money::%uuid of player%}%&a!" else: send "&aThat item cannot be sold!" to player else: send "&aYou don't have any &2%arg 2%&a!" to player command /price <text> [<number>]: trigger: if arg 1 is "list": loop {price::*}: send "&a%loop-index%: &6$%loop-value%" to player else: set {temp_} to arg 1 set {price::%{temp_}%} to arg 2 send "&aPrice of &2%{temp_}% &ais now &6$%{price::%{temp_}%}%&a." to player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Jucs
execute console command "/setblock 4286 24 1106 spawner{SpawnData:{entity:{id:zombie_villager}},Delay:299} destroy"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
function floorTimespan(time: timespan) :: timespan: set {_s} to join (regex split "%{_time}%" at ".\d+") return {_s} parsed as timespan

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: MrScopes
import: org.bukkit.Bukkit command //bound <string>: permission: admin trigger: set {_worldEdit} to Bukkit.getServer().getPluginManager().getPlugin("WorldEdit") set {_session} to {_worldEdit}.getSession(player) set {_selection} to {_session}.getSelection() if {_selection} is set: set {_min} to {_selection}.getMinimumPoint() set {_max} to {_selection}.getMaximumPoint() set {_world} to {_selection}.getWorld() set {_minLoc} to location({_min}.getX(), {_min}.getY(), {_min}.getZ(), {_world}) set {_maxLoc} to location({_max}.getX(), {_max}.getY(), {_max}.getZ(), {_world}) create bound with id arg between {_minLoc} and {_maxLoc} send "&dCreated bound ""%arg%"" between %{_min}% and %{_max}%!" else: send "&cYou must make a selection first."

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
function isLeapYear() :: boolean: if mod((now formatted as "YYYY") parsed as integer, 4) = 0: return true return false

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TF
function splitAt(str: string, n: integer) :: strings: if {_n} > 0: return regex split {_str} at "(?<=\G.{%{_integer}%})" return {_str}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Jake*
player property condition [the] owner of [the] plot at %location%: check: set {_final} to true if parse mark = 0 else false set {_player} to expr-1 set {_location} to expr-2 set {_world} to "%world of {_location}%" set {_x} to x-loc of {_location} set {_y} to y-loc of {_location} set {_z} to z-loc of {_location} set {_loc} to Location.at({_world},{_x},{_y},{_z}) set {_pa} to PlotSquared.get().getPlotAreaManager().getPlotArea({_loc}) {_pa} is set set {_plot} to {_pa}.getPlot({_loc}) continue if {_plot}.isOwnerAbs({_player}.getUniqueId()) is true

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: ˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞
command amongus: trigger: broadcast "&cHalo guyz, welcome back to my amongus sabotage tootorial"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: KiMo
command rwinner: trigger: player is not op: send "&cInsufficient Permissions!" to player else: set {_i} to type of player's tool if name of tool is set: set {_i} to "&d%name of tool% &7&o(x%amount of tool in player's inventory%)" else: set {_i} to "%player's tool%" in strict proper case send "&d&lSERVER NAME &8| &d%player% &7is giving away &d%{_i}% &7it will be given to one random person in the server in 3 seconds!" to all players set {_i} to tool remove player's tool from player's inventory wait 3 seconds set {_r} to random element of players give {_i} to {_r} broadcast "&d&lSERVER NAME &8| &d%{_r}% &7won!"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: ˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞˞
command amongus2: trigger: broadcast "&aOke guyz, am here with part 2 of sabotege tootorial, Steep 1: becom impoestor | Stap 2: saboetege leights | Step 3: kill orange in electrocal | Step 4: sabotege oxygen | Step 5: kill purrple in oxygen | Step 6: leave the matech 4 looseing"

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: TheBiGuy
```if index of clicked slot = 0: if event-player has 32 Cobblestone in their inventory: add 3.2 to player's balance execute console command "clear %player% cobblestone 32" send "&aSold 32 Cobblestone For $3.2" to player```#A Simple Shop skript snip thingy

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Poa
command /hi: trigger: send "Hi" to player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Maj
fish: if "%fishing state%" contains "caught fish": send "Amazing Fishing Skript" to player

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Giuca002
import: java.util.function.BiFunction net.wesjd.anvilgui.AnvilGUI$Builder as AnvilBuilder net.wesjd.anvilgui.AnvilGUI$Response as AnvilResponse function anvilGui(p: player, item: text, itemName: text, title: text): set {_anvil} to new AnvilBuilder() {_anvil}.text({_itemName}) {_anvil}.itemLeft({_item} parsed as item) {_anvil}.title({_title}) {_anvil}.plugin(server.getServer().getPluginManager().getPlugin("Skript")) create new section with {_proxy}, {_p}, {_t} stored in {_handles::apply}: anvilComplete({_p}, {_t}) return AnvilResponse.close() {_anvil}.onComplete(proxy instance of BiFunction using {_handles::*}) {_anvil}.open({_p}) #Example Ussage command /vote: permission: vote.use permission message: &c&l! &fYou do not have permission to do this. trigger: anvilGui(player,"paper","&fType in a name...","Vote For A Player") function anvilComplete(p: player, t: string): set metadata value "anvilOutput" of {_p} to {_t} play sound "block.note_block.pling" to {_p} set {_vote} to metadata value "anvilOutput" of {_p} if {_vote} parsed as player is a player: broadcast "&3[Vote] &f%{_p}% voted for %{_vote}%" else: send "&c&l! &fThis player does not exist, try again." to {_p}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: CoffeeRequired
on script load: load json file "Locations.json" as "LocationStorage" set {-file} to "Locations.json" command saveloc [<string>]: trigger: append data (player's location) with key arg-1 to json file {-file} send "Location &8(&e%player's location%&e)&r saved in the json File." command teleport: trigger: set {_} to element "test" from json (loaded json "gson") send "Teleporting player to Location &8'&etest&8'" teleport player to {_}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: CoffeeRequired
options: Location: "skript-gson/warp/loc.json" on script load: if json file path {@Location} doesn't exists: set {_} to new json file {@Location} load json file {@Location} as "Loc" function setWarp(name: String, loc: Location, p: player): append data {_loc} with key {_name} to json file {@Location} send "Location &8(&e%{_loc}%&e)&r saved in the json File." to {_p} load json file {@Location} as "Loc" function delWarp(name: String): set {_jsonFile} to (loaded json "Loc") remove ~{_name} from {_jsonFile} write data {_jsonFile} to json file {@Location} load json file {@Location} as "Loc" function teleportWarp(name: String, p: player): if (loaded json "Loc") has key {_name}: set {_} to element {_name} from json (loaded json "Loc") send "Teleporting player to Location &8'&e%{_name}%&8'" to {_p} teleport {_p} to {_} else: send "This name of Warp doesn't exist!" to {_p} command warp [<string>] [<text>]: trigger: if arg-1 isn't "add" or "remove": teleportWarp(arg-1, player) else if arg-1 is "add": setWarp(arg-2, player's location, player) else if arg-1 is "remove": delWarp(arg-2)

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Sovde
function smoothLine(loc1: location, loc2: location, step-size: number=0.25) :: locations: # get vector in the right direction set {_v} to vector from {_loc1} to {_loc2} # calculate a step size that's a factor of the distance set {_ideal-steps} to round((vector length of {_v}) / {_step-size}) set {_step-size} to (vector length of {_v}) / {_ideal-steps} # make it the right length set vector length of {_v} to {_step-size} # ideal steps, plus one to make sure we get to the end loop {_ideal-steps} + 1 times: # store location for returning set {_locs::%loop-value%} to {_loc1} # move {_loc1} by one step set {_loc1} to {_loc1} ~ {_v} # return the locations return {_locs::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: Chester8
smoothCircle(v: vector, loc: location, step-size: number=1) :: locations: loop 360 / {_step-size} times: set {_circles::%loop-value%} to {_loc} ~ {_v} add {_step-size} to yaw of {_v} return {_circles::*}

The author hasn't given this Snippet a description yet

This Snippet hasn't got a title yet!

Posted by: JakeTheChad
function getChestItems(b:location) :: items: set ({_nbt::*}) to (tag ("Items") of (nbt compound of (block at {_b}))) return (item from nbt ({_nbt::*}))

Gets the items of a chest