Ban Management

Ban Management

193k Downloads

PlayerData

Leblanct opened this issue ยท 3 comments

commented

Hey there!

As I try to get the player to be punished, using the API
I use:

Player toPunish = Bukkit.getPlayer(args[0]);

however it tells me it has to be a PlayerData when I try to call the BmAPI.mute();

I then used,

PlayerData toPunish = (PlayerData) Bukkit.getPlayer(args[0]);

but now it gives me an error on that line when I do /rmute (that's the command I've set)

Any help?

commented

Thanks guys! But I figured it out before this answers, when I realized there is a ''.getPlayer''.

Thanks a lot though.

commented

PlayerData toPunish = BmAPI.getPlayer(Bukkit.getPlayer(args[0]));

I don't quite think that you understood the concepts of casting objects.

commented

Or alternatively

PlayerData toPunish = BmAPI.getPlayer(args[0]);

assuming args[0] is a String and a players name.