Skip to content

hasItem

albardoo02 edited this page Apr 25, 2026 · 1 revision

Description

インベントリを走査してアイテムの存在と個数をカウントします. 対象がプレイヤーである場合にのみ動作します. ※ItemInSlotの上位互換です.

Attributes

Attribute Aliases Description Default
item mmid, id, material, type, i, m 検出したいアイテムのアイテムIDまたはMMID null
amount a 条件を満たすのに必要なアイテムの個数 1
slot where, w, s チェックするインベントリの MAINHAND

Examples

メインハンドにバニラのダイヤモンドが64個存在する場合,trueを返します.

 Conditions:
 - hasItem{mmid=DIAMOND; a=64}

メインハンドにMMアイテムのExample_Itemが1個以上存在する場合,trueを返します.

 Conditions:
 - hasitem{mmid=Example_Item; where=HAND}

インベントリ内にバニラのダイヤモンドの剣とMMアイテムのExample_Itemがそれぞれ1個以上存在する場合,trueを返します.

 Conditions:
 - hasitem{i=DIAMOND_SWORD, Example_Item; where=INV}

インベントリ内にオークの原木とシラカバの原木がそれぞれ10個以上存在する場合,trueを返します.

 Conditions:
 - hasitem{i=OAK_LOG,BIRCH_LOG; a=10}

Clone this wiki locally