Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Pytanie odnośnie skryptów


Xikser

Rekomendowane odpowiedzi

Opublikowano

Witam. 

 

Moje pytanie brzmi, jak najlepiej i najszybciej nauczyć się skryptowania. Jakieś poradniki ? Szukałem na youtube ale bieda.. Ogarniam już co nieco, ale chcę zacząć pisać profesjonalne skrypty.

Opublikowano

Najłatwiej nauczysz się pisania skryptów metodą prób i błędów oraz analizy skryptów innych. Nie ma chyba na chwile obecną żadnego poradnika, który by nauczył Cię wszystkiego jednak polecam zapoznać Ci się z tym: http://www.mpcforum.pl/topic/1020959-skript-proste-skrypty-do-bukkita/
Oczywiście warto zapoznać się również z poradnikiem autora pluginu: http://njol.ch/projects/skript/tutorial/i jego dokumentacją, która zawiera przykładowe zastosowanie dla każdej z opcji. W skripcie fajne jest to, że jeżeli coś jest źle to dostajesz o tym informacje przez co o wiele łatwiej wyeliminować błędy.

Opublikowano

Dzięki za ten 1-szy link. Większość z tego umiem, ale jest kilka nowych opcji. Jednak nie rozumiem argumentów i to mnie wk.. Co do tej dokumentacji to korzystam z tego. Jednak dzisiaj dałem sobie wyzwanie napisania skryptu i średnio mi to idzie.. 

Opublikowano

­

# Jeżeli zrobisz HashTag możesz dodawać wiadomości np.


#NoTNT
on place:
    event-item is "tnt":
        cancel event
        send "&7Aktualnie TNT jest wylaczone"
        stop #zatrzymujesz komende


Zapisz ten plik jako strona.html

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en">
<meta name="author" content="Peter Güttinger">
<title>Skript: Events</title>
<link rel="shortcut icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" type="text/css" href="/css/normalize.css">
<link rel="stylesheet" type="text/css" href="/css/general.css">
<link rel="stylesheet" type="text/css" href="/css/syntax_elements.css">
<link rel="stylesheet" type="text/css" href="/css/geshi.css">
<link rel="top" title="Home" href="/">
<link rel="author" title="About" href="/about/">
<link rel="copyright" title="Copyright" href="/legal/#license">
<link rel="license" title="Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Switzerland License" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ch/">
<script src="/js.js" type="text/javascript"></script>
</head>
<body>
<div id="header">
<div id="header-content">
<div id="breadcrumb">
<div class="item n1">
<a href="/">Njol.ch</a>
</div>»<div class="item n1">
<a href="/projects/">Projects</a> </div>»<div class="item n3">
<a href="/projects/skript/">Skript</a><a href="/projects/yggdrasil/">Yggdrasil</a><a href="/projects/markup/">Markup</a> </div>»<div class="item n4">
<a href="/projects/skript/doc/">Documentation</a><a href="/projects/skript/tutorial/">Tutorial</a><a href="/projects/skript/API/">API</a><a href="/projects/skript/stats/">Statistics</a> </div>» </div>
<h1 id="title">Skript: Events</h1>
<div id="navi">
<a href="/projects/skript/doc/events/" class="current">Events</a><a href="/projects/skript/doc/conditions/">Conditions</a><a href="/projects/skript/doc/effects/">Effects</a><a href="/projects/skript/doc/expressions/">Expressions</a><a href="/projects/skript/doc/loops/">Loops</a><a href="/projects/skript/doc/commands/">Custom Commands</a><a href="/projects/skript/doc/classes/">Types</a><a href="/projects/skript/doc/strings/">Text</a><a href="/projects/skript/doc/variables/">Variables</a> </div>
</div>
</div>
<div id="content" class="file-syntax_elements">
<div id="toc">
<div id="toc-title">Table of Contents</div>
<ul>
<li><a href="#at_time">At Time</a></li>
<li><a href="#bed_enter">On Bed Enter</a></li>
<li><a href="#bed_leave">On Bed Leave</a></li>
<li><a href="#block_damage">On Block Damage</a></li>
<li><a href="#break_mine">On Break / Mine</a></li>
<li><a href="#bucket_empty">On Bucket Empty</a></li>
<li><a href="#bucket_fill">On Bucket Fill</a></li>
<li><a href="#burn">On Burn</a></li>
<li><a href="#can_build_check">On Can Build Check</a></li>
<li><a href="#chat">On Chat</a></li>
<li><a href="#chunk_generate">On Chunk Generate</a></li>
<li><a href="#chunk_load">On Chunk Load</a></li>
<li><a href="#chunk_unload">On Chunk Unload</a></li>
<li><a href="#click">On Click</a></li>
<li><a href="#combust">On Combust</a></li>
<li><a href="#command">On Command</a></li>
<li><a href="#connect">On Connect</a></li>
<li><a href="#consume">On Consume</a></li>
<li><a href="#craft">On Craft</a></li>
<li><a href="#creeper_power">On Creeper Power</a></li>
<li><a href="#damage">On Damage</a></li>
<li><a href="#death">On Death</a></li>
<li><a href="#dispense">On Dispense</a></li>
<li><a href="#drop">On Drop</a></li>
<li><a href="#endermansheep">On Enderman/Sheep</a></li>
<li><a href="#experience_spawn">On Experience Spawn</a></li>
<li><a href="#explode">On Explode</a></li>
<li><a href="#explosion_prime">On Explosion Prime</a></li>
<li><a href="#fade">On Fade</a></li>
<li><a href="#first_join">On First Join</a></li>
<li><a href="#fishing">On Fishing</a></li>
<li><a href="#flow">On Flow</a></li>
<li><a href="#form">On Form</a></li>
<li><a href="#fuel_burn">On Fuel Burn</a></li>
<li><a href="#gamemode_change">On Gamemode Change</a></li>
<li><a href="#grow">On Grow</a></li>
<li><a href="#heal">On Heal</a></li>
<li><a href="#hunger_meter_change">On Hunger Meter Change</a></li>
<li><a href="#ignition">On Ignition</a></li>
<li><a href="#item_break">On Item Break</a></li>
<li><a href="#item_spawn">On Item Spawn</a></li>
<li><a href="#join">On Join</a></li>
<li><a href="#kick">On Kick</a></li>
<li><a href="#leaves_decay">On Leaves Decay</a></li>
<li><a href="#level_change">On Level Change</a></li>
<li><a href="#lightning_strike">On Lightning Strike</a></li>
<li><a href="#move_on">On Move On</a></li>
<li><a href="#physics">On Physics</a></li>
<li><a href="#pick_up">On Pick Up</a></li>
<li><a href="#pig_zap">On Pig Zap</a></li>
<li><a href="#piston_extend">On Piston Extend</a></li>
<li><a href="#piston_retract">On Piston Retract</a></li>
<li><a href="#place">On Place</a></li>
<li><a href="#portal">On Portal</a></li>
<li><a href="#portal_create">On Portal Create</a></li>
<li><a href="#portal_enter">On Portal Enter</a></li>
<li><a href="#pressure_plate_trip">On Pressure Plate / Trip</a></li>
<li><a href="#projectile_hit">On Projectile Hit</a></li>
<li><a href="#quit">On Quit</a></li>
<li><a href="#redstone">On Redstone</a></li>
<li><a href="#region_enterleave">On Region Enter/Leave</a></li>
<li><a href="#respawn">On Respawn</a></li>
<li><a href="#script_loadunload">On Script Load/Unload</a></li>
<li><a href="#shoot">On Shoot</a></li>
<li><a href="#sign_change">On Sign Change</a></li>
<li><a href="#server_startstop">On Skript Start/Stop</a></li>
<li><a href="#smelt">On Smelt</a></li>
<li><a href="#sneak_toggle">On Sneak Toggle</a></li>
<li><a href="#spawn">On Spawn</a></li>
<li><a href="#spawn_change">On Spawn Change</a></li>
<li><a href="#spread">On Spread</a></li>
<li><a href="#sprint_toggle">On Sprint Toggle</a></li>
<li><a href="#tame">On Tame</a></li>
<li><a href="#target">On Target</a></li>
<li><a href="#teleport">On Teleport</a></li>
<li><a href="#throwing_of_an_egg">On Throwing of an Egg</a></li>
<li><a href="#tool_change">On Tool Change</a></li>
<li><a href="#vehicle_create">On Vehicle Create</a></li>
<li><a href="#vehicle_damage">On Vehicle Damage</a></li>
<li><a href="#vehicle_destroy">On Vehicle Destroy</a></li>
<li><a href="#vehicle_enter">On Vehicle Enter</a></li>
<li><a href="#vehicle_exit">On Vehicle Exit</a></li>
<li><a href="#weather_change">On Weather Change</a></li>
<li><a href="#world_init">On World Init</a></li>
<li><a href="#world_load">On World Load</a></li>
<li><a href="#world_save">On World Save</a></li>
<li><a href="#world_unload">On World Unload</a></li>
<li><a href="#zombie_break_door">On Zombie Break Door</a></li>
<li><a href="#periodical">Periodical</a></li>
</ul>
</div>
<div id="page">
<div id="version-filter">
<form action="./" method="get" onsubmit="return filter_version(this.elements['version'].value)">
<label for="version">Filter for version:</label> <input size="5" id="version" name="version" value="" type="text"> <input value="=>" type="submit">
</form>
</div>The following is a listing of all possible events you can use to start a trigger with. Each trigger can only have one single event, i.e. you cannot create triggers that are called when any of several events occurrs.<br>
<br>
Please also note that the ‘on’ at the start of an event is entirely optional but it just looks better in my opinion, and that most events don't have examples since there is only one way to use them.
<div id="section-at_time" class="section">
<a name="at_time"><h2>At Time</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">at %<a href="../classes/#time">time</a>% [in %<a href="../classes/#world">worlds</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.3.4</td></tr>
</tbody>
</table>
<div class="description" data-id="description">An event that occurs at a given <a href="../classes/#time">minecraft time</a> in every world or only in specific worlds.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">at 18:00
at 7am in "world"</pre>
</div>
</div>
<div id="section-bed_enter" class="section">
<a name="bed_enter"><h2>On Bed Enter</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] bed enter[ing]
[on] [player] enter[ing] [a] bed</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player starts sleeping.</div>
</div>
<div id="section-bed_leave" class="section">
<a name="bed_leave"><h2>On Bed Leave</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] bed leav(e|ing)
[on] [player] leav(e|ing) [a] bed</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player leaves a bed.</div>
</div>
<div id="section-block_damage" class="section">
<a name="block_damage"><h2>On Block Damage</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] block damage</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player starts to break a block. You can usually just use the leftclick event for this.</div>
</div>
<div id="section-break_mine" class="section">
<a name="break_mine"><h2>On Break / Mine</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] (min(e|ing)) [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0 (break), <i>unknown</i> (mine)</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on mine
on break of stone
on mine of any ore</pre>
</div>
</div>
<div id="section-bucket_empty" class="section">
<a name="bucket_empty"><h2>On Bucket Empty</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] bucket empty[ing]
[on] [player] empty[ing] [a] bucket</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player empties a bucket. You can also use the <a href="#place">place event</a> with a check for water or lava.</div>
</div>
<div id="section-bucket_fill" class="section">
<a name="bucket_fill"><h2>On Bucket Fill</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] bucket fill[ing]
[on] [player] fill[ing] [a] bucket</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player fills a bucket. Like the bucket empty event, you can also use the break event with a check for water or lava.</div>
</div>
<div id="section-burn" class="section">
<a name="burn"><h2>On Burn</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] burn[ing] [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a block is destroyed by fire.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on burn
on burn of wood, fences, or chests</pre>
</div>
</div>
<div id="section-can_build_check" class="section">
<a name="can_build_check"><h2>On Can Build Check</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] can build check</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0 (basic), 2.0 ([un]cancellable)</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player rightclicks on a block while holding a block or a placeable item. You can either cancel the event to prevent the block from being built, or uncancel it to allow it.<br>Please note that the <a href="../expressions/#ExprDurability">data value</a> of the block to be placed is not available in this event, only its <a href="../expressions/#ExprIdOf">ID</a>.</div>
</div>
<div id="section-chat" class="section">
<a name="chat"><h2>On Chat</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] chat</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.4.1</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called whenever a player chats.</div>
</div>
<div id="section-chunk_generate" class="section">
<a name="chunk_generate"><h2>On Chunk Generate</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] chunk (generat|populat)(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called after a new chunk was generated.</div>
</div>
<div id="section-chunk_load" class="section">
<a name="chunk_load"><h2>On Chunk Load</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] chunk load[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a chunk loads. The chunk might or might not contain mobs when it's loaded.</div>
</div>
<div id="section-chunk_unload" class="section">
<a name="chunk_unload"><h2>On Chunk Unload</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] chunk unload[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a chunk is unloaded due to not being near any player. Cancel the event to force the server to keep the chunk loaded and thus keep simulating the chunk (e.g. physics, plant growth, minecarts, etc. will keep working and won't freeze).</div>
</div>
<div id="section-click" class="section">
<a name="click"><h2>On Click</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %<a href="../classes/#entitydata">entity type</a>/<a href="../classes/#itemtype">item type</a>%] [(with|using|holding) %<a href="../classes/#itemtype">item type</a>%]
[on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %<a href="../classes/#itemtype">item type</a>% on %<a href="../classes/#entitydata">entity type</a>/<a href="../classes/#itemtype">item type</a>%</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a user clicks on a block, an entity or air with or without an item in their hand.<br>Please note that rightclick events with an empty hand while not looking at a block are not sent to the server, so there's no way to detect them.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on click
on rightclick holding a fishing rod
on leftclick on a stone or obsidian
on rightclick on a creeper
on click with a sword</pre>
</div>
</div>
<div id="section-combust" class="section">
<a name="combust"><h2>On Combust</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] combust[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an entity is set on fire, e.g. by fire or lava, a fireball, or by standing in direct sunlight (zombies, skeletons).
<br>See also: <a href="#ignition">on ignition</a> - called when a block catches fire.</div>
</div>
<div id="section-command" class="section">
<a name="command"><h2>On Command</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] command [%<a href="../classes/#string">text</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player enters a command (not necessarily a Skript command).
<br>Please define a <a href="../commands/">custom command</a> if possible instead of using this event. Use this event only if you need to perform some action on multiple command, e.g. to prevent commands under certain circumstances, to log commands, or to add Skript checks to commands from other plugins that cannot be solved by changing the permissions of the player(s).</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on command
on command "/stop"
on command "pm Njol "</pre>
</div>
</div>
<div id="section-connect" class="section">
<a name="connect"><h2>On Connect</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] connect[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player connects to the server. This event is called before the player actually joins the server, so if you want to prevent players from joining you should prefer this event over <a href="#join">on join</a>.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on connect:
	player doesn't have permission "VIP"
	number of players is larger than 20
	kick the player due to "The last 5 slots are reserved for VIP players."</pre>
</div>
</div>
<div id="section-consume" class="section">
<a name="consume"><h2>On Consume</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player is done eating/drinking something, e.g. an apple, bread, meat, milk or a potion.</div>
</div>
<div id="section-craft" class="section">
<a name="craft"><h2>On Craft</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] craft[ing] [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player crafts an item.</div>
</div>
<div id="section-creeper_power" class="section">
<a name="creeper_power"><h2>On Creeper Power</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] creeper power</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a creeper is struck by lighting and gets powered. Cancel the event to prevent the creeper from being powered.
<br>See also: <a href="#lightning_strike">on lightning strike</a></div>
</div>
<div id="section-damage" class="section">
<a name="damage"><h2>On Damage</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] damag(e|ing) [of %<a href="../classes/#entitydata">entity type</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on damage
on damage of a player</pre>
</div>
</div>
<div id="section-death" class="section">
<a name="death"><h2>On Death</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] death [of %<a href="../classes/#entitydata">entity types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a living entity (including players) dies.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on death
on death of player
on death of a wither or ender dragon:
	broadcast "A %entity% has been slain in %world%!"</pre>
</div>
</div>
<div id="section-dispense" class="section">
<a name="dispense"><h2>On Dispense</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] dispens(e|ing) [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a dispenser dispenses an item.</div>
</div>
<div id="section-drop" class="section">
<a name="drop"><h2>On Drop</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] drop[ing] [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player drops an item from his inventory.</div>
</div>
<div id="section-endermansheep" class="section">
<a name="endermansheep"><h2>On Enderman/Sheep</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] enderman place
[on] enderman pickup
[on] sheep eat</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an enderman places or picks up a block, or a sheep eats grass respectively.</div>
</div>
<div id="section-experience_spawn" class="section">
<a name="experience_spawn"><h2>On Experience Spawn</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [e]xp[erience] [orb] spawn
[on] spawn of [a[n]] [e]xp[erience] [orb]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called whenever experience is about to spawn. This is a helper event for easily being able to stop xp from spawning, as all you can currently do is cancel the event.<br>Please note that it's impossible to detect xp orbs spawned by plugins (including Skript) with Bukkit, thus make sure that you have no such plugins if you don't want any xp orbs to spawn. (Many plugins that only <i>change</i> the experience dropped by blocks or entities will be detected without problems though)</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on xp spawn:
	world is "minigame_world"
	cancel event</pre>
</div>
</div>
<div id="section-explode" class="section">
<a name="explode"><h2>On Explode</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] explo(d(e|ing)|sion)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an entity (a primed TNT or a creeper) explodes.</div>
</div>
<div id="section-explosion_prime" class="section">
<a name="explosion_prime"><h2>On Explosion Prime</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] explosion prime</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an explosive is primed, i.e. an entity will explode shortly. Creepers can abort the explosion if the player gets too far away, while TNT will explode for sure after a short time.</div>
</div>
<div id="section-fade" class="section">
<a name="fade"><h2>On Fade</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] fad(e|ing) [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a block 'fades away', e.g. ice or snow melts.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on fade of snow or ice</pre>
</div>
</div>
<div id="section-first_join" class="section">
<a name="first_join"><h2>On First Join</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] first (join|login)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.3.7</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player joins the server for the first time.</div>
</div>
<div id="section-fishing" class="section">
<a name="fishing"><h2>On Fishing</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] fish[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player fishes something. This is not of much use yet.</div>
</div>
<div id="section-flow" class="section">
<a name="flow"><h2>On Flow</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] flow[ing]
[on] block mov(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a blocks flows or teleports to another block. This not only applies to water and lava, but teleporting dragon eggs as well.</div>
</div>
<div id="section-form" class="section">
<a name="form"><h2>On Form</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] form[ing] [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes, or a block spreads (see <a href="#spread">spread event</a>).</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on form of snow
on form of a mushroom</pre>
</div>
</div>
<div id="section-fuel_burn" class="section">
<a name="fuel_burn"><h2>On Fuel Burn</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] fuel burn[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a furnace burns an item from its <a href="../expressions/#ExprFurnaceSlot">fuel slot</a>.</div>
</div>
<div id="section-gamemode_change" class="section">
<a name="gamemode_change"><h2>On Gamemode Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] game[ ]mode change [to %<a href="../classes/#gamemode">gamemode</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player's <a href="../classes/#gamemode">gamemode</a> changes.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on gamemode change
on gamemode change to adventure</pre>
</div>
</div>
<div id="section-grow" class="section">
<a name="grow"><h2>On Grow</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] grow [of %<a href="../classes/#structuretype">tree type</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a tree or giant mushroom grows to full size.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on grow
on grow of a tree
on grow of a huge jungle tree</pre>
</div>
</div>
<div id="section-heal" class="section">
<a name="heal"><h2>On Heal</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] heal[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an entity is healed, e.g. by eating (players), being fed (pets), or by the effect of a potion of healing (overworld mobs) or harm (nether mobs).</div>
</div>
<div id="section-hunger_meter_change" class="section">
<a name="hunger_meter_change"><h2>On Hunger Meter Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] (food|hunger) (level|met(er|re)|bar) chang(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.4.4</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when the hunger bar of a player changes, i.e. either increases by eating or decreases over time.</div>
</div>
<div id="section-ignition" class="section">
<a name="ignition"><h2>On Ignition</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] ignit(e|ion)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a block starts burning, i.e. a fire block is placed next to it and this block is flammable.
<br>The <a href="#burn">burn event</a> will be called when the block is about do be destroyed by the fire.
<br>See also: <a href="#combust">on combust</a> - called when an entity is set on fire.</div>
</div>
<div id="section-item_break" class="section">
<a name="item_break"><h2>On Item Break</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] tool break[ing]
[on] [player] break[ing] [(a|the)] tool</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.1.1</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player breaks his tool because its damage reached the maximum value.<br>This event cannot be cancelled.</div>
</div>
<div id="section-item_spawn" class="section">
<a name="item_spawn"><h2>On Item Spawn</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] item spawn[ing] [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called whenever an item stack is spawned in a world, e.g. as drop of a block or mob, a player throwing items out of his inventory, or a dispenser dispensing an item (not shooting it).</div>
</div>
<div id="section-join" class="section">
<a name="join"><h2>On Join</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] (login|logging in|join[ing])</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player joins the server. The player is already in a world when this event is called, so if you want to prevent players from joining you should prefer <a href="#connect">on connect</a> over this event.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on join:
	message "Welcome on our awesome server!"
	broadcast "%player% just joined the server!"</pre>
</div>
</div>
<div id="section-kick" class="section">
<a name="kick"><h2>On Kick</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] (kick|being kicked)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player is kicked from the server. You can change the <a href="../expressions/#ExprMessage">kick message</a> or <a href="../effects/#EffCancelEvent">cancel the event</a> entirely.</div>
</div>
<div id="section-leaves_decay" class="section">
<a name="leaves_decay"><h2>On Leaves Decay</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] leaves decay[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a leaf block decays due to not being connected to a tree.</div>
</div>
<div id="section-level_change" class="section">
<a name="level_change"><h2>On Level Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] level [change]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player's <a href="../expressions/#ExprLevel">level</a> changes, e.g. by gathering experience or by enchanting something.</div>
</div>
<div id="section-lightning_strike" class="section">
<a name="lightning_strike"><h2>On Lightning Strike</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] lightning [strike]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when lightning strikes.
<br>Use <a href="#creeper_power">on creeper power</a> and <a href="#pig_zap">on pig zap</a> to find out if one or more creepers and/or pigs were hit.</div>
</div>
<div id="section-move_on" class="section">
<a name="move_on"><h2>On Move On</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] (step|walk)[ing] (on|over) %*<a href="../classes/#itemtype">item types</a>%</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player moves onto a certain type of block. Please note that using this event can cause lag if there are many players online.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on walking on dirt or grass
on stepping on stone</pre>
</div>
</div>
<div id="section-physics" class="section">
<a name="physics"><h2>On Physics</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] physics</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.4.6</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a physics check is done on a block. By cancelling this event you can prevent some things from happening, e.g. sand falling, dirt turning into grass, torches dropping if their supporting block is destroyed, etc.
<br>Please note that using this event might cause quite some lag since it gets called extremely often.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples"># prevents sand from falling
on block physics:
	block is sand
	cancel event</pre>
</div>
</div>
<div id="section-pick_up" class="section">
<a name="pick_up"><h2>On Pick Up</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] (pick[ ]up|picking up) [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player picks up an item. The item is still on the ground when this event is called.</div>
</div>
<div id="section-pig_zap" class="section">
<a name="pig_zap"><h2>On Pig Zap</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] pig[ ]zap</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a pig is struck by lightning and transforms into a zombie pigman. Cancel the event to prevent the transformation.
<br>See also: <a href="#lightning_strike">on lightning strike</a></div>
</div>
<div id="section-piston_extend" class="section">
<a name="piston_extend"><h2>On Piston Extend</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] piston extend[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a piston is about to extend.</div>
</div>
<div id="section-piston_retract" class="section">
<a name="piston_retract"><h2>On Piston Retract</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] piston retract[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a piston is about to retract.</div>
</div>
<div id="section-place" class="section">
<a name="place"><h2>On Place</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [block] (plac(e|ing)|build[ing]) [[of] %<a href="../classes/#itemtype">item types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player places a block.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on place
on place of a furnace, workbench or chest</pre>
</div>
</div>
<div id="section-portal" class="section">
<a name="portal"><h2>On Portal</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] portal</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player uses a nether or end portal. <a href="../effects/#EffCancelEvent">Cancel the event</a> to prevent the player from teleporting.</div>
</div>
<div id="section-portal_create" class="section">
<a name="portal_create"><h2>On Portal Create</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] portal create</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a portal is created, either by a player or mob lighting an obsidian frame on fire, or by a nether portal creating its teleportation target in the nether/overworld.<br>Please note that it's not possible to use <a href="../expressions/#ExprEntity">the player</a> in this event.</div>
</div>
<div id="section-portal_enter" class="section">
<a name="portal_enter"><h2>On Portal Enter</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] portal enter
[on] entering [a] portal</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player enters a nether portal and the swirly animation starts to play.</div>
</div>
<div id="section-pressure_plate_trip" class="section">
<a name="pressure_plate_trip"><h2>On Pressure Plate / Trip</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [step[ping] on] [a] [pressure] plate
[on] (trip|[step[ping] on] [a] tripwire)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0 (pressure plate), 1.4.4 (tripwire)</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a <i>player</i> steps on a pressure plate or tripwire respectively.</div>
</div>
<div id="section-projectile_hit" class="section">
<a name="projectile_hit"><h2>On Projectile Hit</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] projectile hit</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a projectile hits an entity or a block.<br>Use the <a href="#damage">damage event</a> with a <a href="../conditions/#CondIsSet">check</a> for a <a href="../expressions/#ExprEntity">projectile</a> to be able to use the <a href="../expressions/#ExprAttacked">entity that got hit</a> in the case when the projectile hit a living entity.<br>A damage event will even be fired if the damage is 0, e.g. when throwing snowballs at non-nether mobs.</div>
</div>
<div id="section-quit" class="section">
<a name="quit"><h2>On Quit</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] (quit[ting]|disconnect[ing]|log[ ]out|logging out)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player leaves the server. Starting with Skript 2.0 this also includes kicked players.</div>
</div>
<div id="section-redstone" class="section">
<a name="redstone"><h2>On Redstone</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] redstone [current] [chang(e|ing)]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when the redstone current of a block changes. This event is of not much use yet.</div>
</div>
<div id="section-region_enterleave" class="section">
<a name="region_enterleave"><h2>On Region Enter/Leave</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns"><i>cannot be used directly</i></pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.1</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player enters or leaves a <a href="../classes/#region">region</a>.<br>This event requires a supported regions plugin to be installed.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on region exit:
	message "Leaving %region%."</pre>
</div>
</div>
<div id="section-respawn" class="section">
<a name="respawn"><h2>On Respawn</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] respawn[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player respawns. You should prefer this event over the <a href="#death">death event</a> as the player is technically alive when this event is called.</div>
</div>
<div id="section-script_loadunload" class="section">
<a name="script_loadunload"><h2>On Script Load/Unload</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [script] (load|init|enable)
[on] [script] (unload|stop|disable)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called directly after the trigger is loaded, or directly before the whole script is unloaded.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on load:
	set {running.%script%} to true
on unload:
	set {running.%script%} to false</pre>
</div>
</div>
<div id="section-shoot" class="section">
<a name="shoot"><h2>On Shoot</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [projectile] shoot</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called whenever a <a href="../classes/#projectile">projectile</a> is shot. Use the <a href="../expressions/#ExprShooter">shooter expression</a> to get who shot the projectile.</div>
</div>
<div id="section-sign_change" class="section">
<a name="sign_change"><h2>On Sign Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] sign (chang[e]|edit)[ing]
[on] [player] (chang[e]|edit)[ing] [a] sign</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">As signs are placed empty, this event is called when a player is done editing a sign.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on sign change:
	line 2 is empty
	set line 1 to "<red>%line 1%"</pre>
</div>
</div>
<div id="section-server_startstop" class="section">
<a name="server_startstop"><h2>On Skript Start/Stop</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] (server|skript) (start|load|enable)
[on] (server|skript) (stop|unload|disable)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">2.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when the server starts or stops (actually, when Skript starts or stops, so a /reload will trigger these events as well).</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on Skript start
on server stop</pre>
</div>
</div>
<div id="section-smelt" class="section">
<a name="smelt"><h2>On Smelt</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [ore] smelt[ing]
[on] smelt[ing] of ore</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a furnace smelts an item in its <a href="../expressions/#ExprFurnaceSlot">ore slot</a>.</div>
</div>
<div id="section-sneak_toggle" class="section">
<a name="sneak_toggle"><h2>On Sneak Toggle</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] toggl(e|ing) sneak
[on] [player] sneak toggl(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player starts or stops sneaking. Use <a href="../conditions/#CondIsSneaking">is sneaking</a> to get whether the player was sneaking before the event was called.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples"># make players that stop sneaking jump
on sneak toggle:
	player was sneaking
	push the player upwards at speed 0.5</pre>
</div>
</div>
<div id="section-spawn" class="section">
<a name="spawn"><h2>On Spawn</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] spawn[ing] [of %<a href="../classes/#entitydata">entity types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an creature spawns.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on spawn of a zombie
on spawn of an ender dragon:
	broadcast "A dragon has been sighted in %world%!"</pre>
</div>
</div>
<div id="section-spawn_change" class="section">
<a name="spawn_change"><h2>On Spawn Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [world] spawn change</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when the spawn point of a world changes.</div>
</div>
<div id="section-spread" class="section">
<a name="spread"><h2>On Spread</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] spread[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a new block <a href="#form">forms</a> as a result of a block that can spread, e.g. water or mushrooms.</div>
</div>
<div id="section-sprint_toggle" class="section">
<a name="sprint_toggle"><h2>On Sprint Toggle</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] toggl(e|ing) sprint
[on] [player] sprint toggl(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player starts or stops sprinting. Use <a href="../conditions/#CondIsSprinting">is sprinting</a> to get whether the player was sprinting before the event was called.</div>
</div>
<div id="section-tame" class="section">
<a name="tame"><h2>On Tame</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [entity] tam(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player tames a wolf or ocelot. Can be cancelled to prevent the entity from being tamed.</div>
</div>
<div id="section-target" class="section">
<a name="target"><h2>On Target</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [entity] target
[on] [entity] un[-]target</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a mob starts/stops following/attacking another entity, usually a player.
<br>Please note that even though the <a href="../expressions/#ExprTarget">target expression</a> also works for a player's target this event is not called for players.</div>
</div>
<div id="section-teleport" class="section">
<a name="teleport"><h2>On Teleport</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player] teleport[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called whenever a player is teleported, either by a nether/end portal or other means (e.g. by plugins).</div>
</div>
<div id="section-throwing_of_an_egg" class="section">
<a name="throwing_of_an_egg"><h2>On Throwing of an Egg</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] throw[ing] [of] [an] egg
[on] [player] egg throw</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a player throws an egg. You can just use the <a href="#shoot">shoot event</a> in most cases, as this event is intended to support changing the hatched mob and its chance to hatch, but Skript does not yet support that.</div>
</div>
<div id="section-tool_change" class="section">
<a name="tool_change"><h2>On Tool Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] [player['s]] (tool|item held|held item) chang(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called whenever a player changes his held item by selecting a different slot (e.g. the keys 1-9 or the mouse wheel), but <i>not</i> by dropping or replacing the item in the current slot.</div>
</div>
<div id="section-vehicle_create" class="section">
<a name="vehicle_create"><h2>On Vehicle Create</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] vehicle create
[on] creat(e|ing|ion of) [a] vehicle</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a new vehicle is created, e.g. when a player places a boat or minecart.</div>
</div>
<div id="section-vehicle_damage" class="section">
<a name="vehicle_damage"><h2>On Vehicle Damage</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] vehicle damage
[on] damag(e|ing) [a] vehicle</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a vehicle gets damage. Too much damage will <a href="#vehicle_destroy">destroy</a> the vehicle.</div>
</div>
<div id="section-vehicle_destroy" class="section">
<a name="vehicle_destroy"><h2>On Vehicle Destroy</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] vehicle destroy
[on] destr(oy[ing]|uction of) [a] vehicle</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a vehicle is destroyed. Any <a href="../expressions/#ExprPassenger">passenger</a> will be ejected and the vehicle might drop some item(s).</div>
</div>
<div id="section-vehicle_enter" class="section">
<a name="vehicle_enter"><h2>On Vehicle Enter</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] vehicle enter
[on] enter[ing] [a] vehicle</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an <a href="../classes/#entity">entity</a> enters a vehicle, either deliberately (players) or by falling into them (mobs).</div>
</div>
<div id="section-vehicle_exit" class="section">
<a name="vehicle_exit"><h2>On Vehicle Exit</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] vehicle exit
[on] exit[ing] [a] vehicle</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when an entity exits a vehicle.</div>
</div>
<div id="section-weather_change" class="section">
<a name="weather_change"><h2>On Weather Change</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] weather change [to %<a href="../classes/#weathertype">weather types</a>%]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a world's weather changes.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">on weather change
on weather change to sunny</pre>
</div>
</div>
<div id="section-world_init" class="section">
<a name="world_init"><h2>On World Init</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] world init</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a world is initialised. As all default worlds are initialised before any scripts are loaded, this event is only called for newly created worlds.<br>World management plugins might change the behaviour of this event though.</div>
</div>
<div id="section-world_load" class="section">
<a name="world_load"><h2>On World Load</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] world load[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a world is loaded. As with the world init event, this event will not be called for the server's default world(s).</div>
</div>
<div id="section-world_save" class="section">
<a name="world_save"><h2>On World Save</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] world sav(e|ing)</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a world is saved to disk. Usually all worlds are saved simultaneously, but world management plugins could change this.</div>
</div>
<div id="section-world_unload" class="section">
<a name="world_unload"><h2>On World Unload</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] world unload[ing]</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a world is unloaded. This event might never be called if you don't have a world management plugin.</div>
</div>
<div id="section-zombie_break_door" class="section">
<a name="zombie_break_door"><h2>On Zombie Break Door</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">[on] zombie break[ing] [a] [wood[en]] door</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since"><i>unknown</i></td></tr>
</tbody>
</table>
<div class="description" data-id="description">Called when a zombie is done breaking a wooden door. Can be cancelled to prevent the zombie from breaking the door.</div>
</div>
<div id="section-periodical" class="section">
<a name="periodical"><h2>Periodical</h2></a>
<table class="info">
<tbody>
<tr><th><div>patterns<sup><a href="../patterns">[?]</a></sup>:</div></th><td class="patterns"><pre data-id="patterns">every %<a href="../classes/#timespan">time span</a>% in [world[s]] %<a href="../classes/#world">worlds</a>%</pre></td></tr>
<tr><th><div>since:</div></th><td data-id="since">1.0</td></tr>
</tbody>
</table>
<div class="description" data-id="description">An event that is called periodically. The event is used like 'every <<a href="../classes/#timespan">timespan</a>>', e.g. 'every second' or 'every 5 minutes'.</div>
<div class="examples">
<span class="label">examples:</span>
<pre data-id="examples">every second
every minecraft hour
every tick # warning: lag!
every minecraft day in "world"</pre>
</div>
</div>
</div> </div>
<div id="footer">
<div id="footer-content">
<div id="about">
<a href="/about/">About</a>
</div>
<div id="credits">
~ njol.ch created by <a href="/legal/">Peter Güttinger</a>
~ icons by <a href="http://p.yusukekamiyamane.com/" target="_blank">Yusuke Kamiyamane</a> ~
</div>
</div>
</div>

</body></html>

Uważam, że poziom mojej inteligencji nie przekracza poziomu inteligencji przeciętnego człowieka.

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...