Class FakePlayerController
java.lang.Object
net.minestom.server.entity.fakeplayer.FakePlayerController
public class FakePlayerController
extends java.lang.Object
This class acts as a client controller for
FakePlayer
.
The main use is to simulate the receiving of ClientPlayPacket
-
Constructor Summary
Constructors Constructor Description FakePlayerController(FakePlayer fakePlayer)
-
Method Summary
Modifier and Type Method Description void
attackEntity(Entity entity)
void
clickWindow(boolean playerInventory, short slot, byte button, short action, int mode)
void
closeWindow()
void
consumePacket(ServerPacket serverPacket)
Makes the player receives a packet WARNING: pretty much unsafe, used internally to redirect packets here, you should instead usePlayerConnection.sendPacket(ServerPacket)
void
finishDigging(BlockPosition blockPosition)
void
respawn()
void
rotate(float yaw, float pitch)
void
sendArmAnimation(Player.Hand hand)
void
sendPluginMessage(java.lang.String channel, byte[] message)
void
sendPluginMessage(java.lang.String channel, java.lang.String message)
void
setHeldItem(short slot)
void
startDigging(BlockPosition blockPosition)
void
stopDigging(BlockPosition blockPosition)
void
useItem(Player.Hand hand)
-
Constructor Details
-
Method Details
-
clickWindow
public void clickWindow(boolean playerInventory, short slot, byte button, short action, int mode) -
closeWindow
public void closeWindow() -
sendPluginMessage
public void sendPluginMessage(java.lang.String channel, byte[] message) -
sendPluginMessage
public void sendPluginMessage(java.lang.String channel, java.lang.String message) -
attackEntity
-
respawn
public void respawn() -
setHeldItem
public void setHeldItem(short slot) -
sendArmAnimation
-
useItem
-
rotate
public void rotate(float yaw, float pitch) -
startDigging
-
stopDigging
-
finishDigging
-
consumePacket
Makes the player receives a packet WARNING: pretty much unsafe, used internally to redirect packets here, you should instead usePlayerConnection.sendPacket(ServerPacket)
- Parameters:
serverPacket
- the packet to consume
-