* m
entionPlayer without the '@' changes to @<playerName> now.
*Check the spoiler below to see details and what it offers. * Any API ideas you have please put forward.
@EventHandler
publicvoid onJoin
(PlayerJoinEvent event
){ Player player
= event.
getPlayer();
/*/ Checking if the player hasn't played before. * sends message(msg) to the player with @<playerName> */ if(!player.
hasPlayedBefore()){ api.
mentionPlayer(player, ChatColor.
AQUA+"Welcome to the network!"); /*/ sending a sound to player is simple (no need to get location) */ api.
sendPlayerSound(player, Sound.
ENTITY_PLAYER_LEVELUP,
1,
1); }
/*/ if the player has played, we send them this one * sends message(msg) to the player with @<playerName> */ api.
mentionPlayer(player, ChatColor.
GREEN+"Welcome back...");
/*/ sending a sound to player is simple (no need to get location) */ api.
sendPlayerSound(player, Sound.
BLOCK_NOTE_BELL,
1,
1);
/*/ Dealing with everyoneMention is easy. * broadcast to everyone the message. * *not ideal to send this when the player joins but for this demo to see if it works* * * will display @everyone in front of the message('msg') */ api.
mentionEveryone( player.
getName()+"has joined the server!"); /*/ sending a sound to everyone is simple (no need to get location aswell) */ api.
sendEveryoneSound(Sound.
ENTITY_PLAYER_LEVELUP,
2,
2); } }
* If your not a developer still useful to download this version, comes with some 1.15 support features.