diff --git a/src/main/java/ch/njol/skript/events/EvtBlock.java b/src/main/java/ch/njol/skript/events/EvtBlock.java
index 1ae3696edbb..a5b6f1c5407 100644
--- a/src/main/java/ch/njol/skript/events/EvtBlock.java
+++ b/src/main/java/ch/njol/skript/events/EvtBlock.java
@@ -18,6 +18,9 @@
*/
package ch.njol.skript.events;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockState;
+import org.bukkit.block.data.BlockData;
import org.bukkit.event.Event;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockBurnEvent;
@@ -29,7 +32,6 @@
import org.bukkit.event.hanging.HangingEvent;
import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
-import org.bukkit.event.player.PlayerBucketEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.eclipse.jdt.annotation.Nullable;
@@ -42,7 +44,6 @@
import ch.njol.skript.lang.SkriptEvent;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.registrations.Classes;
-import ch.njol.util.Checker;
/**
* @author Peter Güttinger
@@ -51,38 +52,45 @@
public class EvtBlock extends SkriptEvent {
static {
- // TODO 'block destroy' event for any kind of block destruction (player, water, trampling, fall (sand, toches, ...), etc) -> BlockPhysicsEvent?
- // REMIND attacking an item frame first removes its item; include this in on block damage?
- Skript.registerEvent("Break / Mine", EvtBlock.class, new Class[] {BlockBreakEvent.class, PlayerBucketFillEvent.class, HangingBreakEvent.class}, "[block] (break[ing]|1¦min(e|ing)) [[of] %itemtypes%]")
+ if (Skript.isRunningMinecraft(1, 13)) {
+ // TODO 'block destroy' event for any kind of block destruction (player, water, trampling, fall (sand, toches, ...), etc) -> BlockPhysicsEvent?
+ // REMIND attacking an item frame first removes its item; include this in on block damage?
+ Skript.registerEvent("Break / Mine", EvtBlock.class, new Class[]{BlockBreakEvent.class, PlayerBucketFillEvent.class, HangingBreakEvent.class}, "[block] (break[ing]|1¦min(e|ing)) [[of] %itemtypes/blockdatas%]")
.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.")
- .examples("on mine:", "on break of stone:", "on mine of any ore:")
- .since("1.0 (break), unknown (mine)");
- Skript.registerEvent("Burn", EvtBlock.class, BlockBurnEvent.class, "[block] burn[ing] [[of] %itemtypes%]")
+ .examples("on mine:", "on break of stone:", "on mine of any ore:", "on break of chest[facing=north]:", "on break of potatoes[age=7]:")
+ .requiredPlugins("Minecraft 1.13+ (BlockData)")
+ .since("1.0 (break), unknown (mine), INSERT VERSION (BlockData support)");
+ Skript.registerEvent("Burn", EvtBlock.class, BlockBurnEvent.class, "[block] burn[ing] [[of] %itemtypes/blockdatas%]")
.description("Called when a block is destroyed by fire.")
- .examples("on burn:", "on burn of wood, fences, or chests:")
- .since("1.0");
- Skript.registerEvent("Place", EvtBlock.class, new Class[] {BlockPlaceEvent.class, PlayerBucketEmptyEvent.class, HangingPlaceEvent.class}, "[block] (plac(e|ing)|build[ing]) [[of] %itemtypes%]")
+ .examples("on burn:", "on burn of wood, fences, or chests:", "on burn of oak_log[axis=y]:")
+ .requiredPlugins("Minecraft 1.13+ (BlockData)")
+ .since("1.0, INSERT VERSION (BlockData support)");
+ Skript.registerEvent("Place", EvtBlock.class, new Class[]{BlockPlaceEvent.class, PlayerBucketEmptyEvent.class, HangingPlaceEvent.class}, "[block] (plac(e|ing)|build[ing]) [[of] %itemtypes/blockdatas%]")
.description("Called when a player places a block.")
- .examples("on place:", "on place of a furnace, workbench or chest:")
- .since("1.0");
- Skript.registerEvent("Fade", EvtBlock.class, BlockFadeEvent.class, "[block] fad(e|ing) [[of] %itemtypes%]")
+ .examples("on place:", "on place of a furnace, workbench or chest:", "on break of chest[type=right] or chest[type=left]")
+ .requiredPlugins("Minecraft 1.13+ (BlockData)")
+ .since("1.0, INSERT VERSION (BlockData support)");
+ Skript.registerEvent("Fade", EvtBlock.class, BlockFadeEvent.class, "[block] fad(e|ing) [[of] %itemtypes/blockdatas%]")
.description("Called when a block 'fades away', e.g. ice or snow melts.")
- .examples("on fade of snow or ice:")
- .since("1.0");
- Skript.registerEvent("Form", EvtBlock.class, BlockFormEvent.class, "[block] form[ing] [[of] %itemtypes%]")
+ .examples("on fade of snow or ice:", "on fade of snow[layers=2]")
+ .requiredPlugins("Minecraft 1.13+ (BlockData)")
+ .since("1.0, INSERT VERSION (BlockData support)");
+ Skript.registerEvent("Form", EvtBlock.class, BlockFormEvent.class, "[block] form[ing] [[of] %itemtypes/blockdatas%]")
.description("Called when a block is created, but not by a player, e.g. snow forms due to snowfall, water freezes in cold biomes. This isn't called when block spreads (mushroom growth, water physics etc.), as it has its own event (see spread event).")
.examples("on form of snow:", "on form of a mushroom:")
- .since("1.0");
+ .requiredPlugins("Minecraft 1.13+ (BlockData)")
+ .since("1.0, INSERT VERSION (BlockData support)");
+ }
}
@Nullable
- private Literal types;
+ private Literal