Popup Messages

Overview

As of v2.2.0, it is possible for menu commands to display a popup message to the player with the QUICKMSG special command, which can be useful if you want to display some quick status information about something without cluttering up the chat window.

A popup message showing the player's current experience total

The ProtocolLib plugin must be installed for this to work; if QUICKMSG is used without ProtocolLib, the message will just be sent to the player in chat.

Using Popup Messages

The QUICKMSG syntax is QUICKMSG <duration-in-seconds> <message text>.

Example usage:

/sms add mymenu "Check XP" "QUICKMSG 5 You have <EXP> exp."

This will display the player's current XP total for 5 seconds, as in the image above.

Technical Detail

The popup message system exploits the fact that any changes to an item name in Minecraft get briefly displayed to the client (just above the armour/food/health display). For more information on how this works, see this forum post: http://forums.bukkit.org/threads/itemmessage-use-item-metadata-to-create-popup-messages.167979/

Note that due to problem with item metadata persistence, this does not work for players in creative mode. If a player in creative mode uses a QUICKMSG command, the message will simply be displayed in chat, as normal.


Comments

Posts Quoted:
Reply
Clear All Quotes