SuperVanish Support

Discussion in 'Plugin Development' started by MDev, May 29, 2021.

Thread Status:
Not open for further replies.
  1. Offline

    MDev

    Hello,
    I want to ask how can I implement support for the SuperVanish plugin in my plugin? Specifically, I need to change the Join and Quit messages when a player types the /vanish command.
    I tried the code provided by the developer himself, but unfortunately it doesn't work for me:
    Code:
    public static boolean isVanished(Player player) {
    for (MetadataValue meta : player.getMetadata("vanished")) {
    if (meta.asBoolean()) return true;}
    return false;}
    
    Code:
    @EventHandler
    public void joinEvent(PlayerJoinEvent e) {
    Player p = e.getPlayer();
    if (Bukkit.getPluginManager().isPluginEnabled("SuperVanish") || Bukkit.getPluginManager().isPluginEnabled("PremiumVanish")) {
    if (isVanished(p)) {
    e.setJoinMessage("Test");}
    }
    
    So how can I change these yellow messages that SuperVanish has there?

    upload_2021-5-29_10-43-37.png
     
  2. Offline

    xpaintall

    @MDev What do you want exactly? Do the leave and join messages occur when the player types the command or something else? If you want to remove the "player.getName() left the game" & "player.getName() joined the game" I'd recommend that you put nothing inside of the "e.setJoinMessage(String s);" method.
     
Thread Status:
Not open for further replies.

Share This Page