Difference between revisions of "Crab.grab()"

From 8x9craft
Jump to: navigation, search
 
Line 1: Line 1:
 
<source lang=js>
 
<source lang=js>
function grabLeft(item: ItemInfo): boolean
+
function grabLeft(item: ItemStack): boolean
function grabLeft(item: String or Number, meta: Number): boolean
+
function grabLeft(item: string or number, meta: number): boolean
function grabRight(item: ItemInfo): boolean
+
function grabRight(item: ItemStack): boolean
function grabRight(item: String or Number, meta: Number): boolean
+
function grabRight(item: string or number, meta: number): boolean
 
</source>
 
</source>
Put an item from the crab's inventory in its left or right hand.
+
crabの持ち物からアイテムを選んで、はっくんの右手や左手に持たせます。
  
 
'''Parameters:'''
 
'''Parameters:'''
: ''item: ItemInfo'' - [[ItemInfo (Class)|ItemInfo]] object.
+
: ''item: ItemStack'' - [[ItemStack (Class)|ItemStack]] オブジェクト
: ''item: String or Number'' - item name or its ID.
+
: ''item: string or number'' - アイテムの名前かID
: ''meta: Number'' - item's variation ID.
+
: ''meta: number'' - アイテムのバリアントID
  
'''Returns:''' true or false depending on whether the crab could grab an item or not.
+
'''Returns:''' アイテムを持たせられたらtrue、持たせらせなかったらfalseを返します。
  
=== Examples ===
+
=== 使用例 ===
  
 
<source lang=js>
 
<source lang=js>
// Put an item from the crab's inventory in its left hand.
+
// はっくんの持ち物から左手にアイテムを持たせます
 
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);

See also

Navigation menu

Internal error

Jump to: navigation, search
[31c9dca6be8f57a7eaadb037] 2024-03-28 11:21:27: Fatal exception of type "Error"

Navigation menu