Skip to content

Basic Player

Asintoto edited this page Jul 18, 2024 · 4 revisions

Using BasicPlayer class

Here is a quick start guide for the BasicPlayer class


What is it? BasicPlayer is a player wrapper class which aims to simplify some commonly-used method for players.

How to start: In order to get a BasicPlayer object you must do as following:

Player p = Bukkit.getPlayer("Example_User");  // Get the Bukkit Player object of the player named "Example_User"
BasicPlayer basicPlayer = BasicPlayer.from(p);  // Convert the Player to a BasicPlayer (Method reccomended)
BasicPlayer basicPlayer = new BasicPlayer(p);  // Convert the Player to a BasicPlayer (Method NOT reccomended)

Some methods:

basicPlayer.getIP() // Return player's ip address
basicPlayer.kill() // Kill the player
basicPlayer.ban(String reason) // Perma ban the player
basicPlayer.respawn() // Respawn the player after 1 tick
basicPlayer.player() // Get the original player (Useful if you want to use native Bukkit Methods)
basicPlayer.sendMessage(String msg) // Send a message to the player formatted with ColorLib
...

Note: those are NOT all the methods in the BasicPlayer class. For a list of all methods consider checking this

Clone this wiki locally