Mojangより配信されているMinecraft: Pocket EditionのModについて包括的に扱うwikiです。

customThrowableHitEntityHook

最終確認バージョン(MCPE:0.14.3 BL:1.12.8 beta)

概要

function customThrowableHitEntityHook(projectile, itemID, target){
}
Item.defineThrowableで設定したアイテムがエンティティに当たった時に呼び出されるフック関数。
他のフックとの呼び出される順番は、このフック関数の方が優先され、
customThrowableHitEntityHook

projectileHitEntityHook
の順番になっている。

引数

引数説明
Numberplojectile投げられたエンティティのUUID
intitemID投げられたアイテムのID
Numbertarget当たったエンティティのUUID

//
Item.defineThrowable(2000, "apple", 0, "投げリンゴ", 64);
Item.setCategory(2000, ItemCategory.TOOL);
Player.addItemCreativeInv(2000, 64);

function customThrowableHitEntityHook(projectile, itemID, target){
  clientMessage("投げたエンティティ:"+projectile+"\n投げたアイテムのID:"+itemID+"\n当たったエンティティ:"+target);
}

このページへのコメント

n投げた?

0
Posted by カシワモチ 2016年11月27日(日) 16:21:55 返信

コメントをかく


利用規約をご確認のうえご記入下さい

WIKi内検索

メンバーのみ編集できます

メンバー募集!