Thanks to visit codestin.com
Credit goes to github.com

Skip to content

VanishStatusChangeEvent is passed invalid parameters #2604

@ghost

Description

Information

Full output of /ess version:

[14:31:50] [Server thread/INFO]: Server version: 1.14.2-R0.1-SNAPSHOT git-Spigot-df0eb25-f2757f9 (MC: 1.14.2)
[14:31:50] [Server thread/INFO]: EssentialsX version: 2.16.1.125
[14:31:50] [Server thread/INFO]: PermissionsEx version: 1.23.4
[14:31:50] [Server thread/INFO]: Vault version: 1.7.1-b91
[14:31:50] [Server thread/INFO]: You are running unsupported plugins!
[14:31:50] [Server thread/INFO]: You are running an unsupported server version!

Details

Description
I've made custom vanishing command (which just sends 'player left' message on vanish), and I've encountered the following problem: when issuing /v <player> in console, VanishStatusChangeEvent#getAffected is null, while VanishStatusChangeEvent#getController is the <player>.

Steps to reproduce
Here's the code I use in my command which is using EssentialsX API:

@EventHandler
    public void onPlayerVanishStatusChange(VanishStatusChangeEvent event) {
        boolean vanished = event.getValue();
        Player player = event.getAffected().getBase();

        PlayerFakeLogonEvent playerFakeLogonEvent;
        if (vanished) {
            playerFakeLogonEvent = new PlayerFakeLeaveEvent(player);
        } else {
            playerFakeLogonEvent = new PlayerFakeJoinEvent(player);
        }

        // PlayerFakeLogonEvent is my custom event for showing join/quit messages upon vanish/unvanish
        Bukkit.getPluginManager().callEvent(playerFakeLogonEvent);
    }

Expected behavior
/v <player> triggered in the game (not in console) makes VanishStatusChangeEvent#getAffected return target player, and makes VanishStatusChangeEvent#getController return command issuer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: confirmedConfirmed bugs in EssentialsX.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions