API Reference

An API is available for other plugins that wish to offload the warning and punishment of players to PlayerWarn.

public boolean doWarn(CommandSender sender, String WarnSender, String player, String infraction, Boolean notimeout)

Call like this:

//In your main class:
import org.switzerny.minecraft.playerwarn.PlayerWarn;

//Then call this:
playerwarn.doWarn(null, "YourPluginName", "PlayerName", "InfractionName", true);

The first parameter can be a CommandSender or Player, and this object will receive messages about the warning if used. This would normally be the moderator or admin of a server that decided to warn the player, not the player himself.

The last parameter, if true, overrides the cooldown timeout, allowing the call to warn the player in rapid successions. Example: if a user is cussing, warn him for each message sent, however fast they send it, since it's the player doing it to himself.


Comments

Posts Quoted:
Reply
Clear All Quotes