Skip to content

Instantly share code, notes, and snippets.

@toka7290
Created September 23, 2021 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toka7290/18e86b819424aa9222117b600f09811c to your computer and use it in GitHub Desktop.
Save toka7290/18e86b819424aa9222117b600f09811c to your computer and use it in GitHub Desktop.
Minecraft 1.17.40.21 GameTest SimulatedPlayer module method list
/**
* プレイヤーの`componentName`コンポーネントの有無を取得します。
* @param {string} ComponentName コンポーネント ID
*/
SimulatedPlayer.prototype.hasComponent(ComponentName);
/**
* 指定したプレイヤーのコンポーネントを返します
* @param {string} ComponentName コンポーネント ID
* @returns 指定したコンポーネントに応じたオブジェクトを返します。
*/
SimulatedPlayer.prototype.getComponent(ComponentName);
/**
* プレイヤーのコンポーネントをすべて返します
* @returns コンポーネントのオブジェクト配列を返します。
*/
SimulatedPlayer.prototype.getComponents();
/**
* プレイヤーをキルします。
*/
SimulatedPlayer.prototype.kill();
/**
* プレイヤーに付与されているエフェクトを取得します。
* @param {Effect} EffectType 取得するエフェクト
* @returns 指定した`Effect`オブジェクトを返します
*/
SimulatedPlayer.prototype.getEffect(EffectType);
/**
* プレイヤーにエフェクトを付与します。
* @param {EffectType} effectType 設定するエフェクト
* @param {number} duration エフェクトの効果時間
* @param {number} amplifier エフェクトのレベル
* @returns 付与した`Effect`オブジェクトを返します
*/
SimulatedPlayer.prototype.addEffect(effectType, duration, amplifier);
/**
* プレイヤーのイベントをトリガーします。
* @param {string} eventName トリガーするイベント
*/
SimulatedPlayer.prototype.triggerEvent(eventName);
/**
* プレイヤーをジャンプします。
* @return {boolean} ジャンプしたか
*/
SimulatedPlayer.prototype.jump();
/**
* プレイヤーを指定した角度だけ回転させます。
* @param {number} angleInDegrees 回転角度
*/
SimulatedPlayer.prototype.rotateBody(angleInDegrees);
/**
* プレイヤーを指定した角度に回転させます。
* @param {number} angleInDegrees 角度
*/
SimulatedPlayer.prototype.setBodyRotation(angleInDegrees);
/**
* プレイヤーを指定した座標の方に向かせます。
* @param {BlockLocation} blockLocation ブロックの位置
*/
SimulatedPlayer.prototype.lookAtBlock(blockLocation);
/**
* プレイヤーを指定したエンティティの方に向かせます。
* @param {Entity} entity 対象のエンティティ
*/
SimulatedPlayer.prototype.lookAtEntity(entity);
/**
* プレイヤーを指定した座標の方に向かせます。
* @param {Location} location 位置
*/
SimulatedPlayer.prototype.lookAtLocation(location);
/**
* プレイヤーを歩かせます。
* @param {number} westEast 東西方向への移動量
* @param {number} northSouth 南北方向への移動量
* @param {number} speed 速度
*/
SimulatedPlayer.prototype.move(westEast, northSouth, speed);
/**
* プレイヤーを歩かせます(プレイヤー基準)。
* @param {number} leftRight 左右方向への移動量
* @param {number} backwardForward 前後方向への移動量
* @param {number} speed 速度
*/
SimulatedPlayer.prototype.moveRelative(leftRight, backwardForward, speed);
/**
* プレイヤーを歩かせます(対象の位置へ)。
* @param {Location} location 対象の位置
* @param {number} speed 速度
*/
SimulatedPlayer.prototype.moveToLocation(location, speed);
/**
* プレイヤーを歩かせます(対象のブロック位置へ)。
* @param {BlockLocation} blockLocation 対象のブロック
* @param {number} speed 速度
*/
SimulatedPlayer.prototype.moveToBlock(blockLocation, speed);
/**
* プレイヤーを歩かせます(対象の位置へ)。
* @param {Location} location 位置
* @param {number} speed 速度
* @return {ScriptNavigationResult}
*/
SimulatedPlayer.prototype.navigateToLocation(location, speed);
/**
* プレイヤーを歩かせます(設定したルート通りに)。
* @param {Location[]} locations 立ち寄る地点
* @param {number} speed 速度
*/
SimulatedPlayer.prototype.navigateToLocations(locations, speed);
/**
* プレイヤーを歩かせます(対象のブロック位置へ)。
* @param {BlockLocation} blockLocation 対象のブロック
* @param {number} speed 速度
* @return {ScriptNavigationResult}
*/
SimulatedPlayer.prototype.navigateToBlock(blockLocation, speed);
/**
* プレイヤーを歩かせます(対象のエンティティ位置へ)。
* @param {Entity} entity エンティティ
* @param {number} speed 速度
* @return {ScriptNavigationResult}
*/
SimulatedPlayer.prototype.navigateToEntity(entity, speed);
/**
* プレイヤーの移動をやめます
*/
SimulatedPlayer.prototype.stopMoving();
/**
* 攻撃をします
* @return {boolean} 攻撃したか
*/
SimulatedPlayer.prototype.attack();
/**
* 対象のエンティティに対して攻撃をします
* @param {Entity} entity 対象のエンティティ
* @return {boolean} 攻撃したか
*/
SimulatedPlayer.prototype.attackEntity(entity);
/**
* プレイヤーのホッパースロットを選択します。
* @param {number} slot スロット番号0~8
*/
SimulatedPlayer.prototype.selectSlot(slot);
/**
* スロットのアイテムを使用します。アイテムの消費はしません
* @param {number} slot スロット番号0~8
* @return {boolean} アイテムが使用されたか
*/
SimulatedPlayer.prototype.useItemInSlot(slot);
/**
* アイテムを使用します。アイテムの消費はしません
* @param {ItemStack} itemStack 使用するアイテム
* @return {boolean} アイテムが使用されたか
*/
SimulatedPlayer.prototype.useItem(itemStack);
/**
* アイテムをブロックに使用します。アイテムの消費はしません
* @param {ItemStack} itemStack 使用するアイテム
* @param {BlockLocation} blockLocation 使用するブロック
* @param {number} direction アイテムを配置する方向
* @param {number} faceLocationX ブロックの面に対する横方向の位置
* @param {number} faceLocationY ブロックの面に対する縦方向の位置
* @return {boolean} アイテムが使用されたか
*/
SimulatedPlayer.prototype.useItemOnBlock(
itemStack,
blockLocation,
direction,
faceLocationX,
faceLocationY
);
/**
* スロットのアイテムをブロックに使用します。アイテムの消費はしません
* @param {number} slot スロット番号0~8
* @param {BlockLocation} blockLocation 使用するブロック
* @param {number} direction アイテムを配置する方向
* @param {number} faceLocationX ブロックの面に対する横方向の位置
* @param {number} faceLocationY ブロックの面に対する縦方向の位置
* @return {boolean} アイテムが使用されたか
*/
SimulatedPlayer.prototype.useItemInSlotOnBlock(
slot,
blockLocation,
direction,
faceLocationX,
faceLocationY
);
/**
* エンティティに対してインタラクトします。
* @param {Entity} entity 対象のエンティティ
* @return {boolean} インタラクトしたか
*/
SimulatedPlayer.prototype.interactWithEntity(entity);
/**
* ブロックに対してインタラクトします。
* @param {BlockLocation} blockLocation ブロックの位置
* @param {number} direction アイテムを配置する方向
* @return {boolean} インタラクトしたか
*/
SimulatedPlayer.prototype.interactWithBlock(blockLocation, direction);
/**
* プレイヤーの向いている向きに対してインタラクトします。
* @return {boolean} インタラクトしたか
*/
SimulatedPlayer.prototype.interact();
/**
* ブロックを破壊します。
* @param {BlockLocation} blockLocation ブロックの位置
* @param {number} direction 向き
* @return {boolean} 固体ブロックか
*/
SimulatedPlayer.prototype.DestroyBlock(blockLocation, direction);
/**
* ブロックの破壊を止めます
*/
SimulatedPlayer.prototype.stopDestroyingBlock();
/**
* インタラクトを停止します
*/
SimulatedPlayer.prototype.stopInteracting();
/**
* アイテムの使用をやめます
*/
SimulatedPlayer.prototype.stopUsingItem();
/**
* エンティティのidを取得します。
* @type {string}
*/
SimulatedPlayer.prototype.id;
/**
* プレイヤーの座標を取得します。
* @type {Location}
*/
SimulatedPlayer.prototype.location;
/**
* プレイヤーの速度を取得します。
* @type {Location}
*/
SimulatedPlayer.prototype.velocity;
/**
* プレイヤーのネームタグを取得・設定します。
* @type {string}
*/
SimulatedPlayer.prototype.nameTag;
/**
* プレイヤーがスニークしているか
* @type {boolean}
*/
SimulatedPlayer.prototype.isSneaking;
/**
* プレイヤーの名前を取得します。
* @type {string}
*/
SimulatedPlayer.prototype.name;
/**
* プレイヤーの体の回転角を取得します-180~180
* @type {number}
*/
SimulatedPlayer.prototype.bodyRotation;
/**
* プレイヤーの体頭の回転角を取得します
* @type {ScriptPlayerHeadRotation}
*/
SimulatedPlayer.prototype.headRotation;
// ===================ScriptNavigationResult===================
/**
* フルパスかどうか
* @type {boolean}
*/
ScriptPlayerHeadRotation.prototype.isFullPath;
/**
* ルートを構成するブロック位置のリスト
* @type {BlockLocation[]}
*/
ScriptPlayerHeadRotation.prototype.path;
// ===================ScriptPlayerHeadRotation===================
/**
* 頭の上下方向のピッチ
* @type {number}
*/
ScriptPlayerHeadRotation.prototype.pitch;
/**
* 頭の左右方向のヨー
* @type {number}
*/
ScriptPlayerHeadRotation.prototype.yaw;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment