dispatchCommand not working HELP!

Discussion in 'Plugin Development' started by exenaly, Jul 6, 2022.

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

    exenaly

    hello server join use console command to "spawn %player%" or player command to "spawn"
    Code:
        @EventHandler
        public void onPlayerJoin(PlayerJoinEvent p){
        Bukkit.dispatchCommand(Bukkit.getConsoleSender(), ("spawn " + p.getPlayer().getName()));
        }
    not working

    me english for sorry
     
  2. Offline

    CraftCreeper6

    @exenaly
    Registered events?
    Errors?
     
  3. Offline

    Strahan

    Why? PlayerJoinEvent exposes a Player object, and you can use Player#teleport to send them. Dispatching an external command to achieve that is a rather weird way to accomplish it.
     
Thread Status:
Not open for further replies.

Share This Page