Is Lootable (Condition) — Skript

Addon: Skript · Category: Condition · Since: 2.10

Syntax

%blocks/entities% (is|are) lootable

Description

Checks whether an entity or block is lootable. Lootables are entities or blocks that can have a loot table.

Examples

spawn a pig at event-location
set {_pig} to last spawned entity
if {_pig} is lootable:
	set loot table of {_pig} to "minecraft:entities/cow"
	# the pig will now drop the loot of a cow when killed, because it is indeed a lootable entity.
set block at event-location to chest
if block at event-location is lootable:
	set loot table of block at event-location to "minecraft:chests/simple_dungeon"
	# the chest will now generate the loot of a simple dungeon when opened, because it is indeed a lootable block.
set block at event-location to white wool
if block at event-location is lootable:
	# uh oh, nothing will happen because a wool is not a lootable block.

View source