Difference between revisions of "Crab.grab()"
From 8x9craft
N.yamamoto (talk | contribs) |
|||
Line 1: | Line 1: | ||
<source lang=js> | <source lang=js> | ||
− | function grabLeft(item: | + | function grabLeft(item: ItemStack): boolean |
− | function grabLeft(item: | + | function grabLeft(item: string or number, meta: number): boolean |
− | function grabRight(item: | + | function grabRight(item: ItemStack): boolean |
− | function grabRight(item: | + | function grabRight(item: string or number, meta: number): boolean |
</source> | </source> | ||
− | + | crabの持ち物からアイテムを選んで、はっくんの右手や左手に持たせます。 | |
'''Parameters:''' | '''Parameters:''' | ||
− | : ''item: | + | : ''item: ItemStack'' - [[ItemStack (Class)|ItemStack]] オブジェクト |
− | : ''item: | + | : ''item: string or number'' - アイテムの名前かID |
− | : ''meta: | + | : ''meta: number'' - アイテムのバリアントID |
− | '''Returns:''' | + | '''Returns:''' アイテムを持たせられたらtrue、持たせらせなかったらfalseを返します。 |
− | === | + | === 使用例 === |
<source lang=js> | <source lang=js> | ||
− | // | + | // はっくんの持ち物から左手にアイテムを持たせます |
crab.grabLeft('minecraft:diamond_sword', 0); | crab.grabLeft('minecraft:diamond_sword', 0); | ||
</source> | </source> |
Latest revision as of 08:45, 14 July 2017
function grabLeft(item: ItemStack): boolean
function grabLeft(item: string or number, meta: number): boolean
function grabRight(item: ItemStack): boolean
function grabRight(item: string or number, meta: number): boolean
crabの持ち物からアイテムを選んで、はっくんの右手や左手に持たせます。
Parameters:
- item: ItemStack - ItemStack オブジェクト
- item: string or number - アイテムの名前かID
- meta: number - アイテムのバリアントID
Returns: アイテムを持たせられたらtrue、持たせらせなかったらfalseを返します。
使用例
// はっくんの持ち物から左手にアイテムを持たせます
crab.grabLeft('minecraft:diamond_sword', 0);