Skip to content

Releases: LOOHP/InteractiveChat

API and Events (1.5.0)

20 Mar 05:08
de7ee18
Compare
Choose a tag to compare
  • Added an option in the config to limit the number of placeholders players can use in one message
  • Added Events and API

Config Changes:
Added-

Messages:
  #The message to send when a message is cancelled due to the placeholder limit
  LimitReached: "&cPlease do now use excessive amount of placeholders in one message!"

Settings:
  #Set the cooldown that is shared between all placeholders in the plugin (in seconds)
  #Placeholders will not be parsed when a player is in cooldown
  MaxPlaceholders: 3

Here is an example of getting whether a certain placeholder is under cooldown for a specific player

public void simpleMethod(Player player) {
	if (InteractiveChatAPI.isPlaceholderOnCooldown(player, "[item]")) {
		player.sendMessage("You are on cooldown!");
	} else {
		player.sendMessage("You are not on cooldown!");
	}
}

Here is a simple EventHandler to change the title message of the mention ping

@EventHandler
public void onMention(PlayerMentionPlayerEvent event) {
	String sender = event.getSender().getName();
	String newTitle = ChatColor.RED + sender + " PINGED YOU";
	event.setTitle(newTitle);
}

Bug Fix (1.4.13)

19 Mar 08:53
de7ee18
Compare
Choose a tag to compare
  • Fixed a typo in code