Skip to content

Instantly share code, notes, and snippets.

View Snow-Pyon's full-sized avatar

Frank Kusmiruk Snow-Pyon

  • Argentina, Chaco
View GitHub Profile
@Snow-Pyon
Snow-Pyon / !nbt.sk
Last active January 11, 2019 23:09
NBT utilities for Skript using skript-mirror
# normal imports
import:
java.lang.String
java.util.regex.Pattern
org.bukkit.Bukkit
org.bukkit.entity.Entity
org.bukkit.inventory.ItemStack
options:
baltop-format: <light red>[position]<yellow>. [balance] <light grey> - <cmd:/baltop [player]>[player] # I suck at coloring so you may change this
highlight-top: 3 # The position and their balance's color will be changed to them
highlight-color: <light green>
on skript load:
@Snow-Pyon
Snow-Pyon / component-converter.md
Last active May 10, 2018 00:08
Snow-Pyon's script snippets (skript-mirror version)

Chat Component Converter

Converts a chat component json to a human-readable text.

Code

string property skript color[s]:
  get:
    if expression-1 contains "_":

      replace all "_" with " " in {_color}
@Snow-Pyon
Snow-Pyon / component-converter.md
Last active May 10, 2018 00:04
Snow-Pyon's script snippets (function version)

Chat Component Converter

Converts a chat component json to a human-readable text.

Code

function asSkriptColor(color: text) :: text:

  if {_color} contains "_":

    replace all "_" with " " in {_color}
@Snow-Pyon
Snow-Pyon / droppable-recipes.sk
Last active April 21, 2018 03:33
Adds utilities for making recipes from drops!
# Droppable recipes
# Recommended Skript version: 2.2-dev35 or above (https://github.com/bensku/Skript/releases/).
# Minecraft version: 1.12.2 (not guaranteed to work in lower versions)
# Addon dependencies:
# - skript-mirror (https://github.com/btk5h/skript-mirror/releases/)
# - (Optionally) Skellett or RandomSK
@Snow-Pyon
Snow-Pyon / metadata.sk
Last active April 23, 2018 06:31
Metadata utilities script
# Metadata
# Recommended skript version: 2.2-dev35 or above (https://github.com/bensku/Skript/releases/).
# Minecraft version: 1.12.2 (not guaranteed to work in lower versions)
# Addon dependencies:
# - skript-mirror (https://github.com/btk5h/skript-mirror/releases/)
# TODO:
package me.iblitzkriegi.vixio.literals;
import ch.njol.skript.Skript;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.util.SimpleLiteral;
import ch.njol.util.Kleenean;
import org.bukkit.event.Event;
@Snow-Pyon
Snow-Pyon / chat-utils.sk
Created February 4, 2018 04:50
Util script to make manipulation of the play_server_chat packet easier.
packet aliases for play_server_chat:
message of %packet% = chatcomponent pjson 0 of %packet%
message type of %packet% = "ChatType" penum 0 of %packet%
function toSkriptColor(color: text) :: text:
if {_color} contains "_":
replace all "_" with " " in {_color}
package me.iblitzkriegi.vixio.events.base;
import ch.njol.skript.lang.Literal;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.registrations.EventValues;
import ch.njol.skript.util.Getter;
import me.iblitzkriegi.vixio.Vixio;
import me.iblitzkriegi.vixio.util.wrapper.Bot;
on script load:
import "com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager"
import "com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeSearchProvider"
import "ch.njol.skript.variables.Variables"
set {_yt-audio-manager} to new {YoutubeAudioSourceManager}(true)
set {kurisu::instances::yt-search-provider} to new YoutubeSearchProvider({_yt-audio-manager})
effect search (youtube|yt)track %string% and store results in [list] {<(.+)>::*}: