Obsah:- Úvod - K čemu a pro koho to je
- Instalace a konfigurace, co je to kTools.
- Hello world! (první skript, základy vytváření příkazů)
- Vylepšení Hello world! (argumenty příkazů)
- Eventy, relativní a absolutní pozice pomocí kTools
- Počítadlo hráčů (proměnné a konstanty)
- Zablokování griefování knihoven na Spawnu pomocí hůlek z Thaumcraftu (definice vlastních itemů, zakázání eventu, určení vzdálenosti od Spawnu)
- Pole a proměnné s proměnným jménem :-D
- Závěr
ÚvodSkript je plugin, pomocí kterého si můžete udělat vlastní jednoduchý (ale i složitý) plugin bez znalosti Javy. Ptáte se, že takové pluginy tu již jsou, jako například MyCommand. Máte pravdu, ale tyto pluginy jsou oproti Skriptu nuly. Ve Skriptu si totiž můžete nadefinovat nejen vlastní příkazy, ale i můžete ovládat, co se stane při určitých událostech (eventech). Skriptem můžete nahradit spoustu funkcí jiných pluginů, jako např. home, jail, mute, ban, kick... Můžete také udělat spoustu jiných věcí, jako např. automaticky měnící se cedule a mnoho dalších.
Instalace a konfigurace, co je to kToolsInstalace i konfigurace tohoto pluginu je lehká jako u ostatních. Nejdříve si stáhneme tento plugin ze stránky
http://dev.bukkit.org/bukkit-plugins/skript/. Doporučuji stahovat nejnovější Beta build, protože jsou v něm většinou opraveny chyby a přidány další nové a užitečné věci. Stažený soubor Skript.jar přesuneme do složky plugins, co máme na našem serveru a server restartujeme nebo použijeme plugin typu PluginManager (
http://dev.bukkit.org/bukkit-plugins/pm-pluginmanager/) pro načtení Skriptu. Ve složce plugins se nám vytořila složka Skript. V této složce stojí za pozornost složka scripts (tam se ukládají skripty) a soubor aliases-english.sk (zde se definují vlastní aliasy itemů). Soubory .sk jsou obyčejné .yml, takže si nastavte váš oblíbený editor, aby otevíral tyto soubory. Ze složky scripts vše vymažte, nebudete to potřebovat. Cokoliv ve složce scripts začíná znakem
- Skript ignoruje.
Dobré je si do Skriptu stáhnout kTools, to je knihovna do Skriptu, která pomáhá udělat věci, jaké Skript sám o sobě neumí nebo by se dělaly velmi těžko. Je to například přetypovávání dat a získání bloku/chunku pomocí souřadnic x, y a z. KTools stáhnete z topicu na adrese
http://dev.bukkit.org/bukkit-plugins/sk ... t-library/. Odkaz ke stažení je na konci prvního topicu, stáhněte verzi 1.1. Pak jděte do hry, napište /skript reload all a /setorigin. /skript reload all znovu načte všechny skripty co najde ve složce scripts a /setorigin nastaví nulové souřadnice pro kTools. /setorigin se používá pouze jednou, a to po instalaci kTools. Tento přikaz se musí napsat ze hry.
První plugin - Hello worldSkript a kTools už máme nainstalovány, a tak se můžeme vrhnout do našeho prvního pluginu. Tento plugin přidá příkaz /helloworld a po jeho napsání hráči, který ho napsal napíše Hello World!
Ve složce scripts vytvořte nový soubor hello-world.sk (jméno může být libovolné). Jak jsem již zmiňoval, soubory .sk jsou obyčejné textové .yml. Cokoliv za znakem # Skript ignoruje. Do tohoto souboru napište:
Kód: Vybrat vše
command /helloworld: # Definujeme příkaz /helloworld
description: Hello World! # Popis příkazu (myslím si, že se napíše v /help)
usage: /helloworld # Nepovinný parametr, vypíše se hráči, když napíše špatný tvar příkazu.
executable by: players and console # Nepovinný parametr, určuje, jestli příkaz mohou vykonávat jen hráči (players), konzole a commandblocky (console) a nebo obojí (players and console). Pokud neuvedeme, je to jakoby jsme napsali players and console
permission: hello.world # Permission, který musí hráč mít, aby mohl příkaz vykonat
permission message: Nemas prava na provedeni tohoto prikazu # Nepovinný parametr, určuje, co se hráči napíše, když nemá práva na tento příkaz. Když neuvedeme, objeví se nějaká výchozí hláška typu You don't have permissions to access that command.
trigger: # Co se stane po napsání příkazu, tady začínají kouzla :-)
send "Hello World!" to the player # Pošli "Hello World!" hráči, který tento příkaz napsal. The můžeme vynechat. Můžeme taky místo tohoto použít message "Hello World!" a nemusíme zde uvádět hráče.
exit trigger # Nemusíme uvádět, ukončí příkaz
Tak tohle by byl náš první příkaz. Jděte do hry, napište /skript reload all a zkuste to. Jestli vám vše funguje, gratuluji! :-)
Vylepšení Hello world! (argumenty příkazů)V minulé sekci jste se dozvěděli, jak vytvořit příkaz a napsat zprávu hráči. Mimochodem, pokud máte plugin na barvy (Esseentials) tak můžete všude, kde něco někomu posíláte, používat barvy pomocí znaku & a čísla/písmena barvy. Teď si ukážeme, jak udělat příkaz, který pošle určitý text určitému hráči a napíše mu, kdo mu zprávu napsal. Můžete to použít třeba jako /msg.
Kód: Vybrat vše
command /msg <player> <text="Hello World!">: # Definujeme příkaz, který má povinný parametr jméno hráče (musí být online, pokud je online třeba Steve, stačí napsat Ste a Skript si jeho nick doplní) a druhý parametr je typu text. Jestliže tento parametr neuvedeme, nastaví se na "Hello World!". Pokud chcete víc slov, je to potřeba dát do uvozovek. Třeba /msg Steve "Ahoj, jak se mas?"
description: Vylepsene Hello World
permission: test.msg # Opravdu může být cokoliv
trigger:
send "&c%player% ti napsal: &f%argument 2%" to argument 1 # %% v textu značí strukturu, kterou má vyhodnotit Skript. Argumenty se číslují od 1 a místo dlouhého argument stačí použít arg. Místo čísla argumentu můžeme použít i typ argumentu, např. arg-player, arg-text...
Tak máme náš druhý příkaz. Uložte to, ve hře napište /skript reload all a můžete zkoušet. Zde vám napíšu část dlouhého seznamu typů argumetů:
- Player - Hráč, jeho nick si Skript dokáže doplnit
- Offline player - Hráč, může být offline i online, ale Skript si jeho nick nedoplní. Nevím, jestli u tohoto záleží na velikosti písmen v nicku hráče, ale myslím si, že ano
- Item (Material) - Item, který je definovaný v alises-english.sk. Například Stone, Dirt, Grass...
- Integer (Number) - Číslo (1,2,3...)
- Text - Text
Celý seznam naleznete v oficiální dokumentaci (anglicky) která je na adrese
http://njol.ch/projects/skript/doc/.
Tak a teď se přesuneme k něčemu těžšímu.
Eventy, relativní a absolutní pozice pomocí kToolsNyní už jakž-takž umíme udělat příkazy. Teď si ukážeme, jak udělat eventy. Dejme tomu, že chceme, že když někdo vykope diamant, že mu to napíše, že má štěstí a všem hráčům to napíše, že našel dia. To provedeme následovně:
Kód: Vybrat vše
on mine of diamond: # Po vykopání diamantu
send "&bTy máš ale štěstí! :-)" to the player # Pošleme zprávu
broadcast "&6Hráč %player% právě našel &bdiamanty&6!" # Pošlem zprávu všem hráčům
Tak uděláme jednoduchý event. Můžeme si třeba také udělat plugin proti dešti. Je to tak jednoduché:
Kód: Vybrat vše
on weather change: # Při změně počasí
set weather to sunny # Nastav počasí na slunečno
Teď si ukážeme, jak udělat to, že když položíme diamantový blok, tak se na něj položí cedule s textem.
Kód: Vybrat vše
on place of diamond block:
set block above the block to sign # Po položení diamantového bloku se nad ním položí cedule
set line 1 of block above the block to "Kuk :-D" # Nastavíme řádek 1 cedule na "Kuk :-D"
Absolutní pozice je ta, kterou definujeme pomocí x,y a z. Použijeme to k tomu, abysme změnili informační ceduli na text, který chceme.
Kód: Vybrat vše
command /zmenceduli <text=""> <text=""> <text=""> <text="">:
permission: zmen.ceduli
description: Zmenit informacni ceduli na spawnu
usage: /zmenceduli [radek1] [radek2] [radek3] [radek4]
trigger:
make console execute command "/getlocation 10 80 100 world" # Načteme pomocí kTools blok na souřadnicích x: 10, y: 80, z: 100 ve světě world.
set line 1 of {ktools.location} to arg 1# Blok z předchozího řádku se nám uloží do proměnné {ktools.location}. O proměnných si řekneme za chvíli.
set line 1 of {ktools.location} to arg 2
set line 1 of {ktools.location} to arg 3
set line 1 of {ktools.location} to arg 4
message "Cedule byla zmenena!" # Pošleme zprávu hráči co napsal príkaz
Tak to by bylo podle mě vše. Relativní pozici (pozici vzhledem k bloku) můžeme zapsat takto:
- the block above/below/right/left the block
- the block n north/south/east/west of the block - n nahradíme za vzdálenost. Třeba 5 bloků severně od bloku - the block 5 north of the block
Počítadlo hráčů (proměnné a konstanty)Proměnné mohou být buď lokální nebo globální. Lokální jsou dostupné pouze pro trigger, ve kterém byly vytvořeny. Napříkad v příkazu /nastavpromennou vytvoříme lokální proměnnou, ale v /prectipromennou jí nemůžeme přečíst. Globální proměnné jsou pravý opak lokální. Proměnné ve Skriptu jsou ohraničeny znaky {}. Funguje to podobně, jako třeba ve VIP SMSkách tady na FH. Lokální proměnné začínají znakem _. Třeba {_fuj} je lokální proměnná fuj. {bla} je globální proměnná bla. Nechápete to? Ukážeme si to na příkladu:
Kód: Vybrat vše
command /nastav:
description: Popis
permission: skript.nastav
trigger:
set {_lokalni} to ":-D" # Nastavíme lokální proměnnou lokalni na text ":-D".
message "Obsah promenne lokalni: %{_lokalni}%" # Do textu vložíme proměnnou lokalni
command /precti:
description: Popis
permission: skript.precti
trigger:
message "Obsah promenne lokalni: %{_lokalni}%" # Vypíšeme
Když to zkusíte, nevím jestli to Skript vůbec vezme, protože zjistí, že ve druhém případě proměnná {_lokalni} neexistuje. Ale když budeme předpokládat, že to Skript načte bez chyby, tak když napíšeme /nastav tak se nám vypíše obsah proměnné. Pak ale když napíšeme /precti tak se nám nevypíše nic, protože /precti nemá přístup k proměnné z /nastav.
Kdybychom příklad upravili takto:
Kód: Vybrat vše
command /nastav:
description: Popis
permission: skript.nastav
trigger:
set {lokalni} to ":-D"
message "Obsah promenne lokalni: %{lokalni}%" # Do textu vložíme proměnnou lokalni
command /precti:
description: Popis
permission: skript.precti
trigger:
message "Obsah promenne lokalni: %{lokalni}%" # Vypíšeme
Tak nám to už Skript určitě načte bez problému. Když napíšeme /nastav tak se nám vypíše :-D. Když pak napíšeme /precti, tak se nám znova vypíše :-D. Obsah proměnných se ukládá do souboru, to znamená, že přežije restart serveru.
Nyní si uděláme jednoduchý skript s pomocí proměnných a eventů, který nám ukáže počet hráčů online. Skript totiž nemá žádnou možnost, jak zjistit aktuální počet hráčů. Vytvoříme toto:
Kód: Vybrat vše
on join: # Když se někdo připojí do hry
add 1 to {pocethracu} # Přičti 1 do proměnné pocethracu
on leave: # Když někdo opustí hru
remove 1 from {pocethracu} # Odečti 1 z proměnné pocethracu
command /pocethracu:
permission: pocet.hracu
description: Vypíše počet hráčů
trigger:
message "&6Prave je online&a %{pocethracu}%&6 hracu." # Napíšeme obsah proměnné pocethracu tomu, kdo napsal příkaz
Tak to bychom měli jednoduché počítadlo hráčů online. Budete muset restartovat server, aby se hráči začali počítat od 0.
EDIT:Přišel jsem na to, jak spočítat hráče snadněji. O tomto způsobu jsem nevěděl a myslel jsem si, že výše uvedený příklad je jediná možnost, jak počítat hráče. Upravený příklad:
Kód: Vybrat vše
command /pocethracu:
permission: pocet.hracu
description: Vypíše počet hráčů
trigger:
message "&6Prave je online&a %size of all players%&6 hracu." # All players je pole všech hráčů. O polích si přečtěte v dodatku dole. Pomocí size of spočítáme, kolik prvků je v tomto poli.
Zablokování griefování knihoven na Spawnu pomocí hůlek z Thaumcraftu (definice vlastních itemů, zakázání eventu, určení vzdálenosti od Spawnu)Jistě jste se všichni, kteří máte na severu mod ThaumCraft museli vypořádat s griefováním knihoven (přeměnou na Thaumonomicony) na Spawnu pomocí jakékoliv hůlky. Teď je tomu konec! Skript, který teď naprogramujeme zabrání tomuto griefování. Nejdříve si ale budeme muset nadefinovat ID hůlek, protože Skript nemá rád, když se rovnou do něj píšou IDčka itemů. Definování itemů se provádí v souboru aliases-english.sk. Já tam mám třeba tohle:
Kód: Vybrat vše
# ====== Aliases ======
# In this file you can create aliases. An alias is a name for a block or an item, or a collection of such.
# There are hundreds of predefined aliases, so you don't usually need to care about this file.
#
# An alias is nothing more than a mapping from a name to one or more item/block types.
# e.g: 'torch = 50' creates the alias 'torch' and maps it to 50, the ID of a torch.
# So now every time you need a torch you can write torch instead of 50, which is much more intuitive.
# You can make an alias match multiple types by separating them with a comma, e.g. 'water = 8, 9'.
# You can also include data values, e.g. 'orange wool = 35:1'. Data Values can be a range,
# e.g. 'wet farmland = 60:1-8' (60:0 is dry farmland)
#
# == Advanced ==
# As different languages have different ways of forming plurals of words you have to define the plurals of all aliases yourself.
# This is done by adding the plural ending after a ¦ character, e.g. 'log¦s = 17'.
# If the singular and plural have different endings each, use two ¦ characters, e.g. 'bookshel¦f¦ves = 47'.
# If you want to pluralize a word within the alias, use another ¦ character, e.g.. 'bucket¦¦s¦ of water' ('¦¦s¦' means: no singular ending, plural ending 's').
# These plurals are both used by Skript when displaying items, e.g. 2 logs will be displayed as '2 logs',
# while 1 log will be displayed as '1 log', but are also used when parsing, i.e. you can write '1 log' or '2 logs' and both is understood.
#
# Sometimes you want to make a part of an alias optional, e.g. in 'wooden door',
# which is also sometimes called 'wood door', the 'en' can be made optional.
# This can be done by putting the optional part into square brackets ([]):
# wood[en] door = 64 # creates 2 aliases: 'wood door = 64' and 'wooden door = 64'
#
# Some blocks/items have different names, like the slab which is also called step.
# In this case you can simple write something like this:
# (step|slab) = 44 # creates two aliases, 'slab' and 'step', of which both are mapped to '44'
# stone (step|slab) = 44:0 # creates 'stone slab' and 'stone step' mapped to '44:0'
# wood[en] (step|slab) = 44:2 # creates four aliases
#
# Some blocks and items share some different appearances, e.g. wood, saplings and leaves all differ only in their tree type.
# Usually you would have to create the aliases 'birch wood', 'birch sapling', 'redwood wood', 'redwood sapling' etc.
# But this can be shortened by using variations:
# {tree type}: # name of the variation
# regular = :0 # list values here. these have the same syntax as aliases, i.e. they can have ids and data/data ranges,
# redwood = :1 # but you usally only need the data, which is done by typing a colon with no id in front of it.
# birch = :2
# {tree type} wood = 17 # this is resolved to: wood = 17, regular wood = 17:0, redwood wood = 17:1 and birch wood = 17:2
# sapling of {tree type} tree = 6 # you can put a variation anywhere in an alias, it doesn't need to be at the beginning.
# {tree type} leaves = 18
#
# please note that 'wood = 17' is also resolved for '{tree type} wood = 17'. This is usually what you want.
# This does not work with variations where ids are varied and not only data values. There you
# have to add a '{default}' to the variation, which is treated like all other values in the variation
# but without adding it's name to the alias. For examples see 'huge mushrooms' or 'doors'.
#
# If an item has a block with a different ID you should add another two aliases called 'x item' and 'x block', e.g.
# cauldron block = 118
# cauldron item = 380
# cauldron = 118, 380
# This way if you 'give a cauldron to the player' the player will not actually be given the items of the 'cauldron' alias,
# but the items of the 'cauldron item' alias, causing the player to always recieve the correct cauldron item.
# The same applies to setting blocks, though it usually doesn't matter as items are ignored when setting blocks.
# It does matter for e.g. water though:
# water = 8, 9
# water block = 9
# The 'water block' alias only lists the water source block, while the 'water' alias also lists the flowing water block.
# Setting a block to 'water' will thus always place a water source, while checking 'block is water' will work for both
# stationary and flowing water blocks.
#
# If you want to use something else than 'item' and 'block', simply modify the options below:
#
# optional suffixes that can be appended to an alias's name and Skript will still understand it,
# e.g. if you only define an alias 'cake', this will allow users to use 'cake block' and 'cake item' as well.
# These are also used to determine the block and item variants of an alias (see above) And should include singular and plural.
item = item¦s
block = block¦s
# List of alias groups. Only groups listed here are allowed below,
# but you can easily define your own by adding it to this list.
# The groups will be loaded in this order,
# e.g. if 'custom aliases' is loaded after 'default aliases' you can use all default aliases to define your own aliases.
aliases = default aliases, collections, custom aliases
custom aliases:
# === Custom Aliases ===
# I recommend putting your own aliases here.
# You do not have to create an alias if you intend to use it in only one script,
# but you can put it at the beginning of the script like this:
# aliases:
# admin blocks = bedrock, TNT, 52, 56
# wand = blaze rod
#
# This also has the advantage that your script can be used by other people without having to add the aliases to their config.
#
#
# If you want to edit a default alias, you should copy & paste it here to edit it.
# This will make it easier for you if you choose to update Minecraft and more blocks & items are added, in which case
# you can then simply download the updated config and copy & paste this section into it.
#
# The default aliases are loaded before these, so you can use them here.
# You can also override them by creating an alias with the same name.
#example: shorten names
# ss = sandstone
# llb = lapis lazuli block
# ms = monster spawner
#etc.
collections:
# === Collections ===
# all ores
ore¦s = coal ore, iron ore, gold ore, diamond ore, lapis ore, any redstone ore
# fuels, i.e. items which can be burned in the furnace
fuel¦s = lava bucket, blaze rod, any coal, planks, log, huge mushroom, workbench, fence, wooden stairs, trapdoor, sapling, stick, chest, locked chest, jukebox, note block
# note: the above aliases are used in 'furnace automatisation.cfg'
# all food which can be eaten by rightclicking, i.e. doesn't include cake.
food¦s = any apple, mushroom soup, bread, any porkchop, any fish, cookie, melon slice, any beef, any chicken, rotten flesh
# the same list but without raw food & rotten flesh
healthy food¦s = any apple, mushroom soup, bread, cooked porkchop, cooked fish, cookie, melon slice, steak, cooked chicken
# all vehicles, i.e. all minecarts and the boat
vehicle¦s = any minecart, boat
# all plants. By default this does not include pumpkins and melons, but their stems.
plant¦s = leaves, any tall grass, dead bush, any flower, any mushroom, lily pad, vines, melon stem, pumpkin stem, nether wart
default aliases:
# === Default Aliases ===
# -- special --
anything @- = : # ':' matches any ID. You should only use this together with a {variation} that includes a {default} value.
# (':' means '<any id>:<any data>')
something @- = :
everything @- = * # '*' is actually the same as 'every :', but 'every' can't be used in aliases. Thus I made this small hack
# to allow the definition of an 'everything' alias, but please note that '*' cannot be used anywhere else.
# ====== Blocks ======
# -- air --
air @- = 0
nothing @- = 0
none @- = 0
empty @- = 0
[empty] (hand|fist)¦s = 0
bare (hand|fist)¦s = 0
# -- stone --
stone¦s = 1
smooth stone = 1
# -- grass --
grass = 2
grass block = 2
# -- dirt --
dirt = 3
# -- cobblestone --
cobble[stone] = 4
mossy cobble[stone] = 48
# -- planks & saplings: see wood
# -- bedrock --
bedrock = 7
# -- water & lava --
water = 8, 9
water (item|block)¦s = 9
stationary water = 9
water source = 9
flowing water = 8 # change to '8:0-7' if you want to exclude falling water
falling water = 8:8
moving water = 8
lava = 10, 11
lava (item|block)¦s = 11
stationary lava = 11
lava source = 11
flowing lava = 10 # change to '10:0-7' if you want to exclude falling lava
falling lava = 10:8
moving lava = 10
# -- sand & gravel--
sand = 12
gravel = 13
# -- ores & precious blocks --
gold ore¦s = 14
gold block¦s = 41
block¦¦s¦ of gold = 41
iron ore¦s @an = 15
iron block¦s @an = 42
block¦¦s¦ of iron = 42
coal ore¦s = 16
lapis [lazuli] ore¦s = 21
lapis [lazuli] block¦s = 22
# redstone ore: see redstone
diamond ore¦s = 56
diamond block¦s = 57
block¦¦s¦ of diamond = 57
emerald ore¦s @an = 129
emerald block¦s @an = 133
block¦¦s¦ of emerald = 133
# -- wood, leaves, saplings & planks --
{tree type}: # also used for wooden slabs
{default} = :0-15
(normal|regular|oak) = :0, :4, :8, :12
(pine|redwood|fir|spruce) = :1, :5, :9, :13
birch = :2, :6, :10, :14
jungle = :3, :7, :11, :15
{log direction}:
{default} = :0-3
vertical = :0-3
east-west = :4-7
west-east = :4-7
south-north = :8-11
north-south = :8-11
horizontal = :4-11
rotated = :4-11
full[[ ]block] = :12-15
any = :0-15
{log direction no default}:
vertical = :0-3
east-west = :4-7
west-east = :4-7
south-north = :8-11
north-south = :8-11
horizontal = :4-11
rotated = :4-11
full[[ ]block] = :12-15
any = :0-15
{log direction no default} {tree type} (log¦s|wood) = 17
{log direction} {tree type} (log|wood) (item¦s|block¦s) = 17
{tree type} leaves = 18:0-3
{tree type} sapling¦s = 6:0-3
{tree type} plank¦s = 5:0-3
{tree type} wood[en] plank¦s = 5:0-3
# -- sponge --
sponge¦s = 19
# -- glass --
glass = 20
glass pane¦s = 102
thin glass = 102
window¦s = 102
window glass = 102
# -- lapis lazuli --
# lapis ore & block: see ores & blocks
# lapis lazuli: see dyes
# -- dispenser --
dispenser¦s = 23
# -- sandstone --
sand[ ]stone¦s = 24
# -- note block --
note block¦s = 25
# -- bed --
{bed occupied}:
occupied = :4-7, :12-15
(free|empty) = :0-3, :8-11
{bed part}:
(head|top) = :8-15
(foot|bottom) = :0-7
{bed occupied} bed [block] {bed part} = 26
bed¦s = 26, 355
bed block¦s = 26
bed item¦s = 355
# -- minecart rails --
{minerail}:
straight = :0-5
straight flat = :0-1
flat straight = :0-1
curved = :6-9
flat = :0-1, :6-9
inclined = :2-5
{minerail straight}:
flat = :0-1, :8-9
inclined = :2-5, :10-13
# normal rail
[any] {minerail} [minecart] (rail|track)[s] = 27, 28, 66
{minerail} [minecart] (rail|track)[s] (item|block) = 66
# powered rail
{minerail straight} powered [minecart] (rail|track) = 27
{minerail straight} [minecart] booster¦s = 27
{minerail straight} [minecart] booster (rail|track)¦s = 27
{minerail straight} powered [minecart] (rail|track)¦ on¦s on = powered rail:8-15
{minerail straight} powered [minecart] (rail|track)¦ off¦s off = powered rail:0-7
{minerail straight} active powered [minecart] (rail|track)¦s = powered rail:8-15
{minerail straight} inactive powered [minecart] (rail|track)¦s = powered rail:0-7
{minerail straight} [minecart] booster¦ on¦s on = powered rail:8-15
{minerail straight} [minecart] booster¦ off¦s off = powered rail:0-7
{minerail straight} [minecart] booster (rail|track)¦ on¦s on = powered rail:8-15
{minerail straight} [minecart] booster (rail|track)¦ off¦s off = powered rail:0-7
{minerail straight} (active|powered) [minecart] booster¦s = powered rail:8-15
{minerail straight} (inactive|unpowered) [minecart] booster¦s = powered rail:0-7
{minerail straight} (active|powered) [minecart] booster (rail|track)¦s = powered rail:8-15
{minerail straight} (inactive|unpowered) [minecart] booster (rail|track)¦s = powered rail:0-7
# detector rail
{minerail straight} detector [minecart] (rail|track)¦s = 28
{minerail straight} detector [minecart] (rail|track)¦ on¦s on = detector rail:8-15
{minerail straight} detector [minecart] (rail|track)¦ off¦s off = detector rail:0-7
{minerail straight} active detector [minecart] (rail|track)¦s = detector rail:8-15
{minerail straight} inactive detector [minecart] (rail|track)¦s = detector rail:0-7
# activator rail
{minerail straight} activator [minecart] (rail|track)¦s = 157
# -- sticky piston: see redstone
# -- cobweb --
cobweb¦s = 30
# -- vegetation --
# saplings & leaves: see wood
any tall grass = 31:1-2
dead grass = 31:0
tall grass = 31:1
long grass = 31:1
fern¦s = 31:2
dead shrub¦s = 32
dead bush¦es = 32
dandelion¦s = 37
yellow flower¦s = 37
rose¦s = 38
red rose¦s = 38
red flower¦s = 38
flower¦s = 37, 38
mushroom¦s = 39, 40
brown mushroom¦s = 39
red mushroom¦s = 40
{huge mushroom type}:
{default} = 99, 100
brown = 99
red = 100
huge {huge mushroom type} mushroom¦s = :
huge {huge mushroom type} mushroom stem¦s = :10
huge {huge mushroom type} mushroom cap¦s = :1-9 #0 is not a real cap piece
pumpkin¦s = 86
jack-o-lantern¦s = 91
glowing pumpkin¦s = 91
pumpkin stem¦s = 104
pumpkin seeds = 361
pumpkin pie¦s = 400
melon¦s = 103
melon block¦s = 103
melon slice¦s = 360
melon stem¦s = 105
melon seeds = 362
vines = 106
# the amount of vines here refers to the number of vines on the sides of the vine block.
# the top vine is always present if there's a solid block above the vines or the data is 0.
no vine[s] = 106:0
single vine = 106:1, 106:2, 106:4, 106:8
double vine[s] = 106:3, 106:5, 106:9, 106:6, 106:10, 106:12
triple vine[s] = 106:7, 106:11, 106:13, 106:14
quadruple vine[s] = 106:15
lily pad¦s = 111
nether wart¦s = 115, 372
nether wart block¦s = 115
nether wart item¦s = 372
ripe nether wart¦s = 115:3
freshly planted nether wart¦s = 115:0
cocoa = 127
cocoa plant¦s = 127
(freshly planted|small) cocoa [plant¦s] = 127:0-3
medium cocoa [plant¦s] = 127:4-7
(ripe|big|large) cocoa [plant¦s] = 127:8-11
{flower pot}:
(empty|nothing) = :0
(rose|red flower) = :1
(dandelion|yellow flower) = :2
flower = :1-2
(normal|regular|oak) sapling = :3
(pine|redwood|fir|spruce) sapling = :4
birch sapling = :5
jungle [tree] sapling = :6
sapling = :3-6
red mushroom = :7
brown mushroom = :8
mushroom = :7-8
cactus = :9
dead bush = :10
fern = :11
{flower pot} flower pot¦s = 140
{flower pot} flower pot block¦s = 140
flower pot (holding|containing|with) [a[n]] {flower pot} = 140
flower pot item¦s = 390
flower pot¦s = 140, 390
carrot plant¦s = 141
carrot[s] block¦s = 141
carrot[s] [item¦s] = 391
golden carrot¦s = 396
carrot¦ on a stick¦s on sticks = 398
potato plant¦s = 142
potato[es] block¦s = 142
potato[es] [item¦s] = 392
baked potato¦es = 393
poisonous potato¦es = 394
# -- pistons: see redstone
# -- wool and dyes --
# note: it's not possible to make a {colour} variation, as dye and wool colour data values are different.
wool = 35:0-15
white wool = 35:0
orange wool = 35:1
magenta wool = 35:2
light blue wool = 35:3
yellow wool = 35:4
light green wool = 35:5
pink wool = 35:6
gray wool = 35:7
light gray wool = 35:8
cyan wool = 35:9
purple wool = 35:10
blue wool = 35:11
brown wool = 35:12
[dark] green wool = 35:13
red wool = 35:14
black wool = 35:15
dye¦s = 351:0-15
white dye¦s = 351:15
bone[ ]meal¦s = 351:15
orange dye¦s = 351:14
magenta dye¦s = 351:13
light blue dye¦s = 351:12
yellow dye¦s = 351:11
dandelion yellow [dye¦s] = 351:11
light green dye¦s = 351:10
pink dye¦s = 351:9
gray dye¦s = 351:8
light gray dye¦s = 351:7
cyan dye¦s = 351:6
purple dye¦s = 351:5
blue dye¦s = 351:4
lapis [lazuli¦s] = 351:4
cocoa beans = 351:3
brown dye¦s = 351:3
[dark] green dye¦s = 351:2
cactus green [dye¦s] = 351:2
red dye¦s = 351:1
rose red = 351:1
black dye¦s = 351:0
ink sack¦s = 351:0
# -- block 36 --
block 36 = 36
block moved by piston = 36
moving block¦s = 36
# -- flowers & mushrooms: see vegetation
# -- iron & gold block: see ores & blocks
# -- single & double steps / slabs --
{any slab}:
{default} = 44, 126
single = 44, 126
double = 43, 125
{stone slab}:
{default} = 44
single = 44
double = 43
{wooden slab}:
{default} = 126
single = 126
double = 125
{slab facing}:
{default} = :0-7
regular = :0-7
default = :0-7
upside-down = :8-15
any = :0-15
{slab facing no default}:
regular = :0-7
default = :0-7
upside-down = :8-15
any = :0-15
{stone slab type}:
{default} = :0-1, :3-5, :8-9, :11-13
any = :0-1, :3-5, :8-9, :11-13
stone = :0, :8
sandstone = :1, :9
cobble[stone] = :3, :11
brick = :4, :12
stone brick[s]) = :5, :13
{stone slab type no default}:
any = :0-1, :3-5, :8-9, :11-13
stone = :0, :8
sandstone = :1, :9
cobble[stone] = :3, :11
brick = :4, :12
stone brick[s]) = :5, :13
# variation {tree type}: see wood
{slab facing no default} {stone slab} {stone slab type no default} (step|slab)¦s = :
{slab facing} {stone slab} {stone slab type} (step|slab) (block|item)¦s = :
{slab facing no default} {wooden slab} {tree type} [wood[en]] (step|slab)¦s = :0-3, :8-11
{slab facing} {wooden slab} {tree type} (step|slab) (block|item)¦s = :
{slab facing no default} {any slab} (step|slab)¦s = :
{slab facing} {any slab} (step|slab) (block|item)¦s = :
# -- bricks --
[clay] bricks = 45
[clay] brick[s] block¦s = 45
# -- TNT --
TNT¦s = 46
dynamite = 46
# -- bookshelf --
bookshel¦f¦ves = 47
# -- mossy cobblestone: see cobblestone
# -- obsidian --
obsidian = 49
# -- torch --
{torch}: #also used for redstone torches
ground = :5
floor = :5
wall = :1-4
{torch} torch¦es = 50
# -- fire --
fire¦s = 51
(eternal|infinite) fire¦s = 51:15 #never tested this myself
finite fire¦s = 51:0-14
(new|fresh) fire¦s = 51:0
# -- monster spawner --
monster spawner¦s = 52
mob spawner¦s = 52
# -- stairs --
{stairs}:
{default} = 53, 134, 135, 136, 67, 108, 109, 114, 128, 156
(oak|regular|normal) [wood] = 53
(spruce|fir|redwood|pine) [wood] = 134
birch [wood] = 135
jungle [wood] = 136
[any] wood[en] = 53, 134, 135, 136
cobble[stone] = 67
[clay] brick[s] = 108
stone brick[s] = 109
nether [brick[s]] = 114
sand[ ]stone = 128
[nether] quarz = 156
{stairs direction}:
{default} = :0-3
any = :0-7
upside-down = :4-7
{stairs direction no default}:
any = :0-7
upside-down = :4-7
{stairs direction no default} {stairs} stair[s] = :
{stairs direction} {stairs} stair[s] (block|item)¦s = :
# -- chest --
chest¦s = 54
ender chest¦s = 130
trapped chest¦s = 146
# -- redstone wire: see redstone
# -- diamond ore & block: see ores & blocks
# -- crafting table --
crafting table¦s = 58
workbench¦es = 58
# -- crops / wheat --
crops = 59
wheat block¦s = 59
wheat item¦s = 296
wheat = 59, 296
[wheat] seeds = 295
freshly planted (crops|wheat) = 59:0
ripe (crops|wheat) = 59:7
# -- farmland/soil --
(farmland|soil) = 60
dry (farmland|soil) = 60:0
wet (farmland|soil) = 60:1-8
# -- furnace --
furnace¦s = 61, 62
(burning|lighted|lit) furnace¦s = 62
furnace¦ on¦s on = 62
(non-burning|unlighted|unlit|extinguished) furnace¦s = 61
furnace¦ off¦s off = 61
# -- signs --
sign post¦s = 63
wall sign¦s = 68
sign block¦s = 63, 68
sign item¦s = 323
sign¦s = 63, 68, 323
# -- doors, trapdoors and fence gates --
# I currently discourage from creating aliases like 'open door' or doors with specific facings
# as any 'block is <alias>' condition will fail if you click the wrong part of the door.
# 'set <block> to door:1' will correctly place an open door though.
{doortype}:
{default} = 64, 71
wood[en] = 64
iron = 71
{doorhalf}:
top¦s = :8-9
bottom¦s = :0-7
{doortype} door [block] {doorhalf} = :
{doortype} door block¦s = :
wood[en] door item¦s = 324
wood[en] door¦s = 324, 64
iron door item¦s = 330
iron door¦s = 330, 71
door item¦s = 330, 324
door¦s = 330, 71, 324, 64
trapdoor¦s = 96
open[ed] trapdoor¦s = 96:4-7
closed trapdoor¦s = 96:0-3
fence gate¦s = 107
open[ed] fence gate¦s = 107:4-7
closed fence gate¦s = 107:0-3
# -- ladder --
ladder¦s = 65
# -- rails: see minecart rails
# -- coblestone stairs: see stairs
# -- redstone --
[redstone] wire¦s = 55
[redstone] wire¦ on¦s on = 55:1-15
[redstone] wire¦ off¦s off = 55:0
powered [redstone] wire¦s = redstone wire on
unpowered [redstone] wire¦s = redstone wire off
active [redstone] wire¦s = redstone wire on
inactive [redstone] wire¦s = redstone wire off
redstone ore¦s = 73, 74
(active|glowing) redstone ore¦s = 74
(inactive|non-glowing) redstone ore¦s = 73
redstone ore¦ on¦s on = 74
redstone ore¦ off¦s off = 73
# variation {torch}: see torch
{torch} redstone torch¦es = 75, 76
{torch} redstone torch¦ on¦es on = 76
active {torch} redstone torch¦es = 76
{torch} redstone torch¦ off¦es off = 75
inactive {torch} redstone torch¦es = 75
{diodedelay}:
1-tick[-delay] = :0-3
2-tick[-delay] = :4-7
3-tick[-delay] = :8-11
4-tick[-delay] = :12-15
{diodedelay} [redstone] (repeater|diode)[ block]¦s = 93, 94
[redstone] (repeater|diode) item¦s = 356
[redstone] (repeater|diode)¦s = 356, 93, 94
{diodedelay} [redstone] (repeater|diode)[ block]¦ on¦s on = 94
{diodedelay} [redstone] (repeater|diode)[ block]¦ off¦s off = 93
(active|powered) {diodedelay} [redstone] (repeater|diode)[ block]¦s = 94
(inactive|unpowered) {diodedelay} [redstone] (repeater|diode)[ block]¦s = 93
{lever position}:
wall = :1-4, :9-12
ground = :5-6, :13-14
floor = :5-6, :13-14
{lever position} lever¦s = 69
{lever position} lever¦ on¦s on = 69:8-15
(pulled|thrown|active) {lever position} lever¦s = 69:8-15
{lever position} lever¦ off¦s off = 69:0-7
(unpulled|unthrown|inactive) {lever position} lever¦s = 69:0-7
{button}:
{default} = 77, 143
stone = 77
wood[en] = 143
{button} button¦s = :
{button} button¦ on¦s on = :8-15
pressed {button} button¦s = :8-15
active {button} button¦s = :8-15
{button} button¦ off¦s off = :0-7
unpressed {button} button¦s = :0-7
inactive {button} button¦s = :0-7
{pressure plate}:
{default} = 70, 72, 147, 148
wood[en] = 72
stone = 70
gold[en] = 147
iron = 148
{pressure plate} [pressure] plate¦s = :
(pressed|active) {pressure plate} [pressure] plate¦s = :1
(unpressed|inactive) {pressure plate} [pressure] plate¦s = :0
{weighted pressure plate}:
{default} = 147, 148
gold[en] = 147
light = 147
iron = 148
heavy = 148
{weighted pressure plate} weighted [pressure] plate¦s = :
(pressed|active) {weighted pressure plate} weighted [pressure] plate¦s = :1
(unpressed|inactive) {weighted pressure plate} weighted [pressure] plate¦s = :0
piston base¦s = 33
sticky piston base¦s = 29
any piston base¦s = 33, 29
#
piston extension¦s = 34:0-5
sticky piston extension¦s = 34:8-13
any piston extension¦s = 34
#
piston¦s = piston base, piston extension
piston (item|block)¦s = piston base
sticky piston¦s = sticky piston base, sticky piston extension
sticky piston (item|block)¦s = sticky piston base
any piston¦s = 29, 33, 34
#
extended piston base¦s = 33:8-13
extended sticky piston base¦s = 29:8-13
any extended piston base¦s = extended piston base, extended sticky piston base
#
extended piston¦s = extended piston base, piston extension
extended sticky piston¦s = extended sticky piston base, sticky piston extension
any extended piston¦s = any extended piston base, any piston extension
#
retracted piston¦s = 33:0-5
retracted sticky piston¦s = 29:0-5
any retracted piston¦s = retracted piston, retracted sticky piston
redstone lamp¦s = 123, 124
(inactive|unpowered|unlit) restone lamp¦s = 123
restone lamp¦ off¦s off = 123
(active|glowing|powered|lit) redstone lamp¦s = 124
redstone lamp¦ on¦s on = 124
redstone comparator¦s = 149, 150
redstone comparator block¦s = 149
redstone comparator item¦s = 404
(inactive|unpowered) redstone comparator¦s = 149
(active|powered) redstone comparator¦s = 150
daylight sensor¦s = 151
redstone block¦s = 152
block¦¦s¦ of redstone = 152
hopper¦s = 154
dropper¦s = 158
# -- snow & ice --
snow layer¦s = 78
ice [block¦s] @an = 79
snow [block¦s] = 80
# -- cactus --
cact¦us¦i = 81
cactuses = 81
# -- clay block --
clay block¦s = 82
# -- sugar cane --
[sugar] cane¦s = 83, 338
[sugar] cane block¦s = 83
[sugar] cane item¦s = 338
# -- jukebox --
jukebox¦es = 84
# -- fence --
fence¦s = 85
# -- pumpkin & lack-o-lantern: see vegetation
# -- nether stuff --
netherrack¦s = 87
soul[ ]sand¦s = 88
glowstone¦s = 89
[nether] portal¦s = 90
# -- cake --
cake¦s = 92, 354
cake block¦s = 92
cake item¦s = 354
# -- redstone repeater: see redstone
# -- locked chest --
locked chest¦s = 95
# -- trapdoor: see doors
# -- hidden silverfish --
silverfish block¦s = 97:0-2
hidden silverfish¦es = 97:0-2
[hidden] [smooth] stone silverfish¦es = 97:0
[hidden] cobble[stone] silverfish¦es = 97:1
[hidden] stone brick[s] silverfish¦es = 97:2
# -- stone bricks --
stone brick¦s = 98:0-3
<any> stone brick¦s = 98:0-3
stone brick[s] (item|block)¦s = 98:0
smooth [stone] brick¦s = 98:0
mossy [stone] brick¦s = 98:1
cracked [stone] brick¦s = 98:2
(circle|fancy|decorated) [stone] brick¦s = 98:3
# -- huge mushrooms: see vegetation
# -- iron bars --
[iron] bars @x = 101
# -- glass pane: see glass
# -- melon, stems & vines: see vegetation
# -- fence gate: see doors
# -- brick & stone brick stairs: see stairs
# -- mycelium --
mycelium = 110
mushroom (floor|ground|grass) = 110
# -- lily pad: see vegetation
# -- nether brick stuff --
nether brick¦s = 112, 405
nether brick block¦s = 112
nether brick item¦s = 405
nether [brick[s]] fence¦s = 113
# nether brick stairs: see stairs
# -- nether wart: see vegetation
# -- enchantment table --
enchantment table¦s = 116
# -- brewing stand --
brewing stand¦s = 117, 379
brewing stand block¦s = 117
brewing stand item¦s = 379
empty brewing stand¦s @an = 117:0
full brewing stand¦s = 117:7
# -- cauldron --
cauldron¦s = 118, 380
cauldron block¦s = 118
cauldron item¦s = 380
empty cauldron¦s @an = 118:0
full cauldron¦s = 118:3
# -- End stuff --
end[er] portal¦s @an = 119
end[er] portal frame¦s @an = 120
empty end[er] portal frame¦s @an = 120:0-3
filled end[er] portal frame¦s = 120:4-7
end[er] stone¦s @an = 121
dragon egg¦s = 122
ender[ ]dragon egg¦s @an = 122
# -- redstone lamp: see redstone
# -- emerald ore/block: see ores
# -- ender chest: see chest
# -- tripwire & hook
tripwire¦s = 132
[tripwire] hook¦s = 131
# -- wooden stairs: see stairs
# -- command block --
command block¦s = 137
# -- beacon --
beacon¦s = 138
# -- cobblestone walls --
cobble[stone] wall¦s = 139:0-1
cobble[stone] wall (item|block)¦s = 139:0
(normal|regular) cobble[stone] wall¦s = 139:0
moss[y] cobble[stone] wall¦s = 139:1
# -- flower pot, carrots, potatoes: see vegetation --
# -- wooden button: see redstone --
# -- mob head --
{mob head direction}:
floor = :1
wall = :2-5
{mob head type}:
skeleton = :0
wither skeleton = :1
zombie = :2
(human|player) = :3
creeper = :4
{mob head type} [mob] head[ item]¦s = 397
{mob head direction} [mob] head[ block]¦s = 144
[mob] head¦s = 144, 397
# -- anvil --
{anvil}:
(regular|complete) @a = :0-1
undamaged @an = :0-1
[slightly] damaged @a = :4-5
(very|heavily|severely) damaged @a = :8-9
{anvil} anvil¦s @an = 145
# -- trapped chest: see chest
# -- weighted pressure plates, redstone comparator, daylight sensor, redstone block: see redstone
# -- nether quarz ore, quarz block --
[nether] quartz ore = 153
{quartz block}:
(normal|regular) = :0
chiseled = :1
pillar = :2-3
vertical pillar = :2
horizontal pillar = :3-4
ns pillas = :3
ew pillar = :4
{quartz block} [nether] quartz = 155
{quartz block} [nether] quartz block¦s = 155
pillar [nether] quartz (block|item) = 155:2
[nether] quartz = 155, 406
[nether] quartz item¦s = 406
# quarz stairs: see stairs
# -- hopper: see redstone
# -- activator rail: see rails
# -- dropper: see redstone
# ====== Items ======
# -- flint and steel --
flint and steel¦s = 259
flint'n'steel¦s = 259
# -- apples --
<any> apple¦s = 260, 322:0-1
apple¦s @an = 260
red apple¦s = 260
golden apple¦s = 322:0-1
golden apple item¦s = 322:0
enchanted golden apple¦s @an = 322:1
# -- bow & arrow --
bow¦s = 261
arrow¦s = 262
# -- coal --
<any> coal = 263:0-1
coal = 263:0
charcoal = 263:1
# -- diamond & ingots --
diamond¦s = 264
iron (ingot|bar)¦s @an = 265
gold[en] (ingot|bar)¦s = 266
ingot¦s @an = 265, 266
# -- tools --
sword¦s = 267, 268, 272, 276, 283
pick[axe]¦s = 270, 274, 257, 278, 285
axe¦s @an = 271, 275, 258, 279, 286
shovel¦s = 269, 273, 256, 277, 284
spade¦s = shovel
hoe¦s = 290, 291, 292, 293, 294
wood[en] tool¦s = 268, 269, 270, 271, 290
stone tool¦s = 272, 273, 274, 275, 291
iron tool¦s @an = 256, 257, 258, 267, 292
diamond tool¦s = 276, 277, 278, 279, 293
gold[en] tool¦s = 283, 284, 285, 286, 294
wood[en] sword¦s = 268
wood[en] (shovel|spade)¦s = 269
wood[en] pick[axe]¦s = 270
wood[en] axe¦s = 271
wood[en] hoe¦s = 290
stone sword¦s = 272
stone (shovel|spade)¦s = 273
stone pick[axe]¦s = 274
stone axe¦s = 275
stone hoe¦s = 291
iron sword¦s @an = 267
iron (shovel|spade)¦s @an = 256
iron pick[axe]¦s @an = 257
iron axe¦s @an = 258
iron hoe¦s @an = 292
diamond sword¦s = 276
diamond (shovel|spade)¦s = 277
diamond pick[axe]¦s = 278
diamond axe¦s = 279
diamond hoe¦s = 293
gold[en] sword¦s = 283
gold[en] (shovel|spade)¦s = 284
gold[en] pick[axe]¦s = 285
gold[en] axe¦s = 286
gold[en] hoe¦s = 294
# -- stick --
stick¦s = 280
# -- bowl & stew --
bowl¦s = 281
empty bowl¦s @an = 281
[mushroom] (stew|soup)¦s = 282
# -- string --
string¦s = 287
# -- feather --
feather¦s = 288
# -- gunpowder --
gunpowder = 289
sulphur = 289
# -- wheat & seeds: see crops / wheat
bread¦s = 297
# -- armour --
helmet¦s = 298, 302, 306, 310, 314
chestplate¦s = 299, 303, 307, 311, 315
leg[ging]s @x = 300, 304, 308, 312, 316
boots @x = 301, 305, 309, 313, 317
leather armo[u]r¦s = 298, 299, 300, 301
chain[mail] armo[u]r¦s = 302, 303, 304, 305
iron armo[u]r¦s = 306, 307, 308, 309
diamond armo[u]r¦s = 310, 311, 312, 313
gold armo[u]r¦s = 314, 315, 316, 317
leather (cap|helmet)¦s = 298
leather (tunic|chest[plate])¦s = 299
leather (pants|leg[ging]s) @x = 300
leather boots @x = 301
chain[mail] helmet¦s = 302
chain[mail] chestplate¦s = 303
chain[mail] leggings @x = 304
chain[mail] boots @x = 305
iron helmet¦s @an = 306
iron chest[plate]¦s @an = 307
iron leg[ging]s @x = 308
iron boots @x = 309
diamond helmet¦s = 310
diamond chest[plate]¦s = 311
diamond leg[ging]s @x = 312
diamond boots @x = 313
gold[en] helmet¦s = 314
gold[en] chest[plate]¦s = 315
gold[en] leg[ging]s @x = 316
gold[en] boots @x = 317
# -- flint --
flint¦s = 318
# -- porkchop --
[<any>] pork[chop]¦s = 319, 320
pork[chop] item¦s = 319
raw pork[chop]¦s = 319
(cooked|grilled) pork[chop]¦s = 320
# -- painting --
painting¦s = 321
painting item¦s = 321
# -- golden apple: see apples
# sign: see signs
# wooden door: see doors
# -- buckets --
[empty] bucket¦s = 325
water bucket¦s = 326
bucket¦¦s¦ of water = 326
lava bucket¦s = 327
bucket¦¦s¦ of lava = 327
milk [bucket¦s] = 335
bucket¦¦s¦ of milk = 335
# -- minecarts --
[<any>] minecart¦s = 328, 342, 343
minecart item¦s = 328
storage minecart¦s = 342
minecart¦¦s¦ with chest = 342
powered minecart¦s = 343
minecart¦¦s¦ with furnace = 343
minecart¦¦s¦ with TNT = 407
minecart¦¦s¦ with hopper = 408
# -- saddle --
saddle¦s = 329
# -- iron door: see doors
# -- redstone dust --
redstone = 331
redstone dust = 331
# -- snowball --
snowball¦s = 332
# -- boat --
boat¦s = 333
# -- leather --
leather = 334
# -- milk: see buckets
# -- clay & clay brick --
[clay] brick¦s = 336
clay [ball¦s] = 337
# -- sugar cane: see sugar cane block
# -- paper & books --
paper = 339
book¦s = 340
book¦¦s¦ (and|with) quill = 386
written book¦s = 387
# -- slimeball --
slime[ball¦s] = 341
# minecart with chest/furnace: see minecarts
# -- [chicken] egg --
egg¦s @an = 344
chicken egg¦s = 344
# -- compass --
compass¦es = 345
# -- fishing rod --
fishing rod¦s = 346
# -- clock --
clock¦s = 347
# -- glowstone dust --
glowstone dust = 348
# -- fish --
[<any>] fish¦es = 349, 350
fish item¦s = 349
raw fish¦es = 349
cooked fish¦es = 350
# -- dyes: see wool & dyes
# -- bone --
bone¦s = 352
# -- sugar --
sugar = 353
# -- cake: see cake block
# -- bed: see bed block
# -- redstone repeater: see redstone
# -- cookie --
cookie¦s = 357
# -- map --
map¦s = 358
<any> map¦s = 358:0-32767
empty map¦s @an = 395
# You can get a specific map with map:#, e.g. map:0 for map_0 (the first map crafted)
# (The maximum map number is 65536, but Skript currently only supports numbers up to 32767)
# -- shears --
shears = 359
# -- melon slice, pumpkin seeds & melon seeds: see vegetation
# -- beef --
[<any>] beef = 363, 364
beef item¦s = 363, 364
[raw] beef = 363
steak¦s = 364
cooked beef = 364
# -- chicken --
[<any>] chicken¦s = 365, 366
chicken item¦s = 365
raw chicken¦s = 365
cooked chicken¦s = 366
# -- rotten flesh --
rotten flesh = 367
# -- ender pearl --
ender pearl¦s @an = 368
# -- blaze rod --
blaze rod¦s = 369
# -- ghast tear --
ghast tear¦s = 370
# -- gold nugget --
gold nugget¦s = 371
# -- nether wart: see vegetation
# -- potions & bottles --
[glass] bottle¦s = 374
vial¦s = 374
water bottle¦s = 373:0
bottle¦¦s¦ of water = 373:0
awkward potion¦s @an = 373:16
{splash potion}:
{default} = :0-16383
non-splash = :0-16383
splash = :16384-32767
{splash potion no default}:
non-splash = :0-16383
splash = :16384-32767
{extended potion}:
{default} = :0-63, :16384-16447
unextended @an = :0-63, :16384-16447
non-extended = :0-63, :16384-16447
extended @an = :64-127, :16448-16511
{extended potion no default}:
unextended @an = :0-63, :16384-16447
non-extended = :0-63, :16384-16447
extended @an = :64-127, :16448-16511
{potion tier}:
{default} = :0-31, :64-95, :16384-16415, :16448-16479
(1|I) = :0-31, :64-95, :16384-16415, :16448-16479
(2|II) = :32-63, :96-127, :16416-16447, :16480-16511
{potion tier no default}:
(1|I) = :0-31, :64-95, :16384-16415, :16448-16479
(2|II) = :32-63, :96-127, :16416-16447, :16480-16511
{potion effect}:
Regeneration = :1, :33, :65, :97, :16385, :16417, :16449, :16481
(Swiftness|Speed) = :2, :34, :66, :98, :16386, :16418, :16450, :16482
Fire Resistance = :3, :35, :67, :99, :16387, :16419, :16451, :16483
Poison = :4, :36, :68, :100, :16388, :16420, :16452, :16484
(Healing|[Instant] Health) = :5, :53, :69, :101, :16389, :16421, :16453, :16485
Night Vision = :6, :38, :70, :102, :16390, :16422, :16454, :16486
Weakness = :8, :40, :72, :104, :16392, :16424, :16456, :16488
Strength = :9, :41, :73, :105, :16393, :16425, :16457, :16489
Slowness = :10, :42, :74, :106, :16394, :16426, :16458, :16490
(Harming|[Instant] Damage) = :12, :44, :76, :108, :16396, :16428, :16460, :16492
Invisibility = :14, :46, :78, :110, :16398, :16430, :16462, :16494
{extended potion no default} {splash potion no default} potion¦¦s¦ [of {potion effect} {potion tier no default}] = 373
{extended potion} {splash potion} potion¦¦s¦ [of {potion effect} {potion tier}] item = 373
{extended potion no default} {splash potion no default} {potion effect} potion¦¦s¦ {potion tier no default} = 373
{extended potion} {splash potion} {potion effect} potion {potion tier} item¦s = 373
# -- spider eye & fermented spider eye --
spider eye¦s = 375
fermented spider eye¦s = 376
# -- blaze powder --
blaze powder = 377
# -- magma cream --
magma cream¦s = 378
# -- eye of ender --
eye¦¦s¦ of ender @an = 381
# -- glistering melon --
glistering melon¦s = 382
# -- spawn egg --
{entity type}:
experience orb @an = :2
xp orb = :2
TNT = :20
minecart = :40
boat = :41
creeper = :50
skeleton = :51
spider = :52
giant = :53
zombie = :54
slime = :55
ghast = :56
zombie pigman = :57
pig[ ]zombie = :57
enderman @an = :58
cave spider = :59
silverfish = :60
blaze = :61
magma cube = :62
ender dragon @an = :63
wither = :64
witch = :66
bat = :65
pig = :90
sheep = :91
cow = :92
chicken = :93
squid = :94
wolf = :95
mooshroom = :96
snow golem = :97
ocelot @an = :98
iron golem @an = :99
villager = :120
ender crystal = :200
{entity type} spawn egg¦s = 383
random spawn egg¦s = 383:50-62, 383:65-66, 383:90-99 # only mobs & animals (excluding the enderdragon & wither)
# -- bottle o' enchanting --
bottle¦¦s¦ (o'|of) enchanting = 384
(xp|exp[erience]) bottle¦s @an = 384
# -- fire charge --
fire charge¦s = 385
# -- book and quill, written book: see book
# -- emerald --
emerald¦s = 388
# -- item frame --
item frame¦s = 389
# -- flower pot: see vegetation --
# -- carrot, potatoes: see vegetation --
# -- empty map: see map --
# -- golden carrot: see vegetation --
# -- mob head: see mob head block --
# -- carrot on a stick: see vegetation --
# -- nether star --
nether star¦s = 399
# -- pumpkin pie: see vegetation --
# -- Fireworks --
firework rocket¦s = 401
firework star¦s = 402
# -- Enchanted Book --
enchanted book¦s @an = 403
# -- redstone comparator: see redstone
# -- nether brick item: see nether brick stuff
# -- nether quarz: see nether quarz block
# -- minecart with TNT/hopper: see minecarts
# -- music discs --
music disc¦s = 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 2267
record¦s = music disc
gold [music] disc¦s = 2256
13-disc¦s = 2256
green [music] disc¦s = 2257
cat [music] disc¦s = 2257
blocks [music] disc¦s = 2258
chirp [music] disc¦s = 2259
far [music] disc¦s = 2260
mall [music] disc¦s = 2261
mellohi [music] disc¦s = 2262
stal [music] disc¦s = 2263
strad [music] disc¦s = 2264
ward [music] disc¦s = 2265
11-disc¦s = 2266
wait [music] disc¦s = 2267
Hned nahoře je kategorie Custom aliases, tam se píšou aliasy. Napíšeme
tam tohle:
Kód: Vybrat vše
wand¦s = 25256, 25257, 25258 # Za = napíšeme IDčka hůlek (ne těch barevných). Já to mám třeba takhle. wand¦s znamená, že ve Skriptu můžeme používat buď wand nebo wands.
Pak vytvoříme nový skript ve složce scripts a napíšeme do něj:
Kód: Vybrat vše
on right click on a bookshelf with wand: # Po pravokliknutím s hůlkou (definovali jsme jí výše) na knihovnu
set {_loc} to location of block # Nastav lokální proměnnou loc na pozici knihovny
set {_spawnloc} to location of spawn point of player's world # Nastav lokální proměnnou spawnloc na pozici spawnu světa, ve kterém je hráč
if distance between {_loc} and {_spawnloc} is less than 250: # Vzdálenost mezi těmi pozicemi je menší než 250 kostek
cancel the event # Zruš ten event. Zrušení eventu znamená to, že se neprovedou akce pro tento event. Třeba že se nepoloží nebo nezničí blok, tnt nevybouchne...
Pole a proměnné s proměnným jménem :-DTak už víte, jak se dělají základní proměnné. Věděli jste ale, že můžete dávat kousky kódu vyhodnocované Skriptem i do názvu proměnných? Například takto?
Toto je zcela validní zápis. Podrobněji si ho ukážeme na příkladu pluginu pro /home.
Kód: Vybrat vše
command /sethome <text="vychozi">:
description: Nastavi domov hrace
usage: /sethome [jmenodomova]
permission: home.set
trigger:
set {domovy.%player%.%arg 1%} to location of the player # Nastav proměnnou na pozici hráče.
message "&aTvuj domov byl nastaven."
command /home <text="vychozi">:
description: Teleportuje hrace domu
usage: /home [jmenodomova]
permission: home.tp
trigger:
if {domovy.%player%.%arg 1%} is set: # Promenna je nastavena - hrac uz pouzil /sethome
teleport the player to {domovy.%player%.%arg 1%}
else: # Promenna neni nastavena
message "&cDomov s timto jmenem neexistuje."
Dejme tomu, že hráč Steve napíše /sethome. Protože nenapsal první argument příkazu, nastaví se na hodnotu "vychozi". Skript si tak řádek
Kód: Vybrat vše
set {domovy.%player%.%arg 1%} to location of the player
přeloží na tohle:
Kód: Vybrat vše
set {domovy.Steve.vychozi} to location of the player
Vlastně to tak úplně není pravda, protože %player% neznamená nick hráče, ale i další jeho vlastnosti. Takto by se to přeložilo, kdybychom místo %player% použili %name of player%. K tomu se ale dostaneme možná později.Proměnná se nastaví na umístění hráče. Jako umístění hráče se kromě souřadnic bere i směr, jakým se dívá a naklonění hlavy. Pak když náš Steve napíše /home, tak se zkontroluje, zda taková proměnná už byla někdy nastavena. Pokud byla, tak teleportuje hráče zpět na pozici, která je v této proměnné uložena. Pokud taková proměnná neexistuje, napíše to hráči chybovou zprávu.
Teď přejdeme k polím. Jestli ještě vše po tento řádek, chápete, je dost možné, že se to teď změní. Pole si můžete představit jako proměnnou, která dokáže uložit více hodnot. Aby pak bylo možné s hodnotami pracovat, každé hodnotě se přidělí nějaký klíč, podle kterého se dá hodnota znova najít. Můžeme si to představit jako tabulku:
Kód: Vybrat vše
=== Struktura pole ===
+---+--------------------+
| 0 | Hodnota pro klíč 0 |
| 1 | Hodnota pro klíč 1 |
| 2 | Hodnota pro klíč 2 |
| 3 | Hodnota pro klíč 3 |
| 4 | Hodnota pro klíč 4 |
+---+--------------------+
Tato celá tabulka se nám uloží do jediné proměnné. Klíč bývá většinou číslo, ale nic nám nebrání, aby to byl i text. Pole se ve Skriptu zapíše jako
{jméno pole::*}. Nyní si ukážeme, jak zapsat hodnotu do pole.
Kód: Vybrat vše
add hodnota to {jméno pole::*} # Přidá hodnotu na konec pole a přiřadí jí číselný klíč o jednu větší, než je klíč předchozí hodnoty. Hodnota může být cokoliv.
set {jméno pole::1} to hodnota # Přidá hodnotu do pole a přiřadí jí klíč 1. Pokud už nějaká hodnota s klíčem 1 existuje, tak jí přepíše.
set {jméno pole::bla} to hodnota # Jak jsem již zmiňoval, klíče nemusí být číselné, ale mohou být i textové.
Teď už umíme přidat do pole hodnotu. Ale jak jí přečteme? Můžeme na ní odkázat jejím klíčem:
Kód: Vybrat vše
broadcast "%{jméno pole::1}%" # Vypíše hodnotu z pole, která má klíč 1
Teď už umíme přečíst pole pomocí klíče. Málem bych zapomněl zmínit, že Skript má už nějaká pole v sobě. Tyto pole neobalujeme do složených závorek. Konkrétně pole:
Kód: Vybrat vše
all players # Obsahuje všechny hráče
blocks around [blok] in radius [radius] # Všechny bloky v kruhu okolo určitého bloku
A možná ještě další. Zase vás ale odkážu na oficiální dokumentaci, protože vše z hlavy nevím. Nyní si ukážeme, jak procházet pole pomocí funkce loop.
Kód: Vybrat vše
set {_online} to "" # Nastavíme si proměnnou
loop all players: # Procházíme všechny hráče na serveru
set {_online} to "%{_online}% %name of loop-player% # Přidáme k proměnné jméno aktuálního hráče
broadcast "&6Online hráči: &a%{_online}%" # Vypíšeme
Na třetím řádku jste si mohli všimnout, že používáme
loop-player. Toto znamená, že to má brát hráče, u kterého právě jsme. Teď si ukážeme, jak procházet vlastní pole.
Kód: Vybrat vše
add "prvni" to {pole::*}
add "druhy" to {pole::*}
add "treti" to {pole::*} # Naplníme pole
loop {pole::*}: # Procházíme všechny hodnoty v poli. Aktuální hodnota je uložena do loop-value a aktuální klíč do loop-index.
message "%loop-index%: %loop-value%"
Toto po provedení vypíše:
Klíče začínají od 0. Funkci loop můžeme používat také pro opakování bloku kódu x-krát.
Samozřejmě můžeme používat i proměnné:
Kód: Vybrat vše
set {_pocet} to 5
loop {_pocet} times:
message "Ahoj"
Tak to by bylo asi všechno k polím a funkci loop. Ještě nějaký bonusy:
Kód: Vybrat vše
add 1 to {_pocet} # Načte obsah proměnné počet, přičte k tomu 1 a uloží to zpět do proměnné počet. To samé funguje s remove, multiply a divide. (odečte,vynásobí,vydělí)
wait [x] seconds # Čeká určitý počet sekund
ZávěrTak to by bylo asi všechno o Skriptu, co byste měli vědět. Samozřejmě to není vůbec nic z toho, co Skript umí. Všechno o Skriptu najdete na jeho oficiální dokumentaci tady:
http://njol.ch/projects/skript/doc/. Doufám, že jsem vám zmírnil trable s hledáním někoho, kdo umí v javě. Já jsem zatím ve Skriptu udělal třeba jail, který není na čas, ale hráč musí dát do truhly určitý počet cobblestonu, který vytěží dřevěným krumpáčem z pomalého cobble generátoru, který je na tlačítko, aby hráč nemohl AFKovat se zatíženou myší. Jestli jste to dočetli až sem, máte u mě malé bezvýznamné + :-D Samozřejmě, že kdybyste zde našli nějakou chybu (příklad nefunguje, pravopis...) nebo jste měli nějaký dotaz, tak vám rád odpovím, a také doufám, že nejento nebo někdo jiný ze supportu toto vloží do seznamu návodů.
Seznam skriptů v Návodech:// EDIT: Přišel jsem na to, jak počítat hráče, a proto jsem upravil příklad.
// EDIT: Přidána sekce pole a nějaké bonusy
// EDIT: Přidal jsem seznam skriptů tady na fóru //nejento