Class FakePlayer
java.lang.Object
com.shanebeestudios.nms.api.world.entity.FakePlayer
Represents a fake
ServerPlayer
Can create in PlayerApi.spawnFakePlayer(String, Location)
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the player to the player listvoidattach(net.minecraft.world.entity.Entity entity) Attach an entity to a fake playervoidAttach an entity to a fake playerGet the Bukkit Entity this FakePlayer may be attached to@Nullable net.minecraft.world.entity.EntityGet the Entity this FakePlayer may be attached to@Nullable McEntityGet an McEntity this FakePlayer may be attached toGet a wrapper Minecraft version of this FakePlayernet.minecraft.world.entity.player.PlayerGet the Minecraft Player of this FakePlayervoidMove this player to a new locationvoidremove()Remove this fake playervoidRemove the player from the player listvoidTeleport this player to another locationtoString()voidupdate()Update for all players onlinevoidUpdate for a single Player
-
Method Details
-
getMCPlayer
Get a wrapper Minecraft version of this FakePlayer- Returns:
- Wrapper of FakePlayer
-
getAttachedEntity
@Nullable public @Nullable net.minecraft.world.entity.Entity getAttachedEntity()Get the Entity this FakePlayer may be attached toMay be null if this FakePlayer was never attached
- Returns:
- Attached entity if present else null
-
getAttachedBukkitEntity
Get the Bukkit Entity this FakePlayer may be attached toMay be null if this FakePlayer was never attached
- Returns:
- Attached Bukkit Entity if present else null
-
getAttachedMcEntity
Get an McEntity this FakePlayer may be attached toMay be null if this FakePlayer was never attached
- Returns:
- Attached McEntity if present else null
-
attach
public void attach(net.minecraft.world.entity.Entity entity) Attach an entity to a fake playerThis will visually look like the player is doing what the entity would be doing
- Parameters:
entity- Entity to attach
-
attach
Attach an entity to a fake playerThis will visually look like the player is doing what the entity would be doing
- Parameters:
bukkitEntity- Entity to attach
-
teleport
Teleport this player to another locationCurrently does not support changing worlds/levels.
NOTE: If there is an attached entity, its best to just teleport that entity instead.
- Parameters:
location- Location to teleport to
-
moveTo
Move this player to a new locationNOTE: Should be <= 8 blocks, this is used for general player movement, not teleporting
NOTE: If there is an attached entity, just move/teleport that entity instead.
- Parameters:
location- Location to move player to
-
update
Update for a single Player- Parameters:
player- Player to update for
-
update
public void update()Update for all players online -
removeFromPlayerList
public void removeFromPlayerList()Remove the player from the player list -
addToPlayerList
public void addToPlayerList()Add the player to the player list -
remove
public void remove()Remove this fake player -
getServerPlayer
public net.minecraft.world.entity.player.Player getServerPlayer()Get the Minecraft Player of this FakePlayer- Returns:
- Minecraft Player
-
toString
-