showPlayerIsTalking()
showPlayerIsTalking
Method in MelodyManager
Class
showPlayerIsTalking
Method in MelodyManager
ClassMethod Signature
public void showPlayerIsTalking(MelodyPlayer player)
Parameters
Parameter
Type
Description
player
MelodyPlayer
The player whose talking status is to be displayed.
Example
Here is an example of how to use the showPlayerIsTalking
method in another plugin:
import ir.taher7.melodymine.core.MelodyManager;
import ir.taher7.melodymine.models.MelodyPlayer;
public class ExamplePlugin {
public void displayTalkingStatus(String playerUUID) {
MelodyPlayer player = MelodyManager.INSTANCE.getMelodyPlayer(playerUUID);
if (player != null) {
MelodyManager.INSTANCE.showPlayerIsTalking(player);
Bukkit.getLogger().info("Displaying talking status for player " + player.getName());
} else {
Bukkit.getLogger().warning("Player not found.");
}
}
}
In this example, the displayTalkingStatus
method in the ExamplePlugin
class retrieves the MelodyPlayer
instance for the player using their UUID. It then uses the showPlayerIsTalking
method of the MelodyManager
class to display the talking status of the player. If the status is successfully displayed, a message is logged to the console. If the player is not found, a warning is logged instead.
Last updated