player
prev_position
player.prev_position() : BlockPos
set_position
player.set_position(double x, double y, double z)
create_position
player.create_position(double x, double y, double z) : BlockPos
set_position
player.set_position(double x, double y, double z)
set_motion
player.set_motion(double motionX, double motionY, double motionZ)
motion
player.motion() : BlockPos
position
player.position() : BlockPos
moveInput
player.moveInput() : MovementInput
message
player.message(string message)
right_click_mouse
player.right_click_mouse()
click_mouse
player.click_mouse()
jump
player.jump()
set_sprinting
player.set_sprinting(boolean sprint)
distance_to
player.distance_to(double x, double y, double z) : double
distance_to_entity
player.distance_to_entity(int entityID) : double
send0x0A
player.send0x0A()
C0APacketAnimation
send0x07
player.send0x07(string action, string facing, BlockPos position)
C07PacketPlayerDigging
,传入Action,Facing和BlockPos,BlockPos可以使用create_position
方法创建
Action可以填写以下字符串之一
START_DESTROY_BLOCK // 开始破坏
ABORT_DESTROY_BLOCK // 取消破坏
STOP_DESTROY_BLOCK // 停止破坏
DROP_ALL_ITEMS // 丢弃所有物品
DROP_ITEM // 丢弃物品
RELEASE_USE_ITEM // 释放使用
SWAP_HELD_ITEMS // 切换手持物品
Facing可以填写以下字符串之一
DOWN
UP
EAST
WEST
SOUTH
NORTH
send0x08
player.send0x08(ItemStack stack)
C08PacketPlayerBlockPlacement
,传入ItemStack
send0x0B
player.send0x0B(string action)
C0BPacketEntityAction
,传入Action
Action可以填写以下字符串之一
START_SNEAKING // 开始潜行
STOP_SNEAKING // 停止潜行
STOP_SLEEPING // 停止睡觉
START_SPRINTING // 开始疾跑
STOP_SPRINTING // 停止疾跑
RIDING_JUMP // 骑行生物跳跃
OPEN_INVENTORY // 打开物品栏
send0x03
player.send0x03(boolean onGround)
C03PacketPlayer
,传入OnGround
send0x09
player.send0x09(int slot)
C09PacketHeldItemChange
,传入slot id
send0x0d
player.send0x0d(int windowId)
C0DPacketCloseWindow
,传入window Id
send0x04
player.send0x04(double x, double y, double z, boolean onGround)
C04PacketPlayerPosition
,传入坐标和OnGround
send0x05
player.send0x05(float yaw, float pitch, boolean onGround)
C05PacketPlayerLook
,传入转头信息和OnGround
angles
player.angles() : Rotation
prev_angles
player.prev_angles() : Rotation
set_angles
player.set_angles(float yaw, float pitch)
apply_angles
player.apply_angles(Rotation rotation)
using_item
player.using_item() : boolean
swing_item
player.swing_item()
use_item
player.use_item()
held_item
player.held_item() : ItemStack
id
player.id() : int
health
player.health() : float
fall_distance
player.fall_distance() : float
max_health
player.max_health() : float
name
player.name() : string
base_speed
player.base_speed() : double
held_item_slot
player.held_item_slot() : int
set_held_item_slot
player.set_held_item_slot(int slot)
hurt_time
player.hurt_time() : int
food_stats
player.food_stats() : int
absorption
player.absorption() : float
eye_height
player.eye_height() : float
facing
player.facing() : string
DOWN
UP
EAST
WEST
SOUTH
NORTH
over_mouse
player.over_mouse() : int
返回玩家准星瞄准的类型,什么都没瞄准返回1
,实体返回他的Entity ID,其他返回-1
over_mouse
player.over_mouse() : int
返回玩家准星瞄准的类型,什么都没瞄准返回1
,实体返回他的Entity ID,其他返回-1
convert_speed
player.convert_speed(MoveEvent event, double speed)
设置MoveEvent的Speed,关于MoveEvent,请查看Events中的on_player_move
kill_aura_target
player.kill_aura_target() : int
kill_aura_targets
player.kill_aura_targets() : int[]
on_ground
player.on_ground() : boolean
is_blocking
player.is_blocking() : boolean
is_in_water
player.is_in_water() : boolean
is_in_lava
player.is_in_lava() : boolean
burning
player.burning() : boolean
is_sneaking
player.is_sneaking() : boolean
set_sneaking
player.set_sneaking(boolean sneak)
设置玩家潜行状态
is_in_cobweb
player.is_in_cobweb() : boolean
返回玩家是否在蜘蛛网里
angles_for_cords
player.angles_for_cords(double x, double y, double z) : Rotation
获取Rotation到某个指定坐标
dead
player.dead() : boolean
sprinting
player.sprinting() : boolean
riding
player.riding() : boolean
on_ladder
player.on_ladder() : boolean
collided_vertically
player.collided_vertically() : boolean
collided_horizontally
player.collided_horizontally() : boolean
is_potion_active
player.is_potion_active(int id) : boolean
ticks_existed
player.ticks_existed() : int
place_block
player.place_block(int slot, BlockPos pos, string facing, BlockPos Vec) : boolean
facing可以填写以下字符串中的一个
DOWN
UP
EAST
WEST
SOUTH
NORTH
is_moving
player.is_moving() : boolean
is_on_edge
player.is_on_edge() : boolean
get_speed
player.get_speed() : double
set_speed
player.set_speed(double speed)
send0x02
player.send0x02(int entityID, string action)
C02PacketUseEntity
,第一个参数填写目标实体的ID,第二个填写Action
Action可以填写以下字符串中的任意一个
INTERACT
ATTACK
INTERACT_AT
is_in_void
player.is_in_void() : boolean
is_third_person_view
player.is_third_person_view() : boolean
set_fall_distance
player.set_fall_distance(float distance)
food
player.food() : int
send_message
player.send_message(string message)
inventory
player.inventory() : ItemTable