Is Preferred Tool (Condition) — Skript

Addon: Skript · Category: Condition · Since: 2.7

Syntax

%itemtypes% (is|are) %blocks/blockdatas%'s preferred tool[s]

Description

Checks whether an item is the preferred tool for a block. A preferred tool is one that will drop the block's item when used. For example, a wooden pickaxe is a preferred tool for grass and stone blocks, but not for iron ore.

Examples

on left click:
	event-block is set
	if player's tool is the preferred tool for event-block:
		break event-block naturally using player's tool
	else:
		cancel event

View source