GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.72k stars 678 forks source link

/help and /? on Bedrock always use the vanilla commands #2573

Open Hypermoron opened 3 years ago

Hypermoron commented 3 years ago

Describe the bug

Running the /help or /? commands on a Bedrock client will always return the vanilla list of commands, regardless of permissions or aliases specified by the server.

To Reproduce

  1. Connect with the Java client and run /? and /help
  2. Connect with the Bedrock client and run /? and /help. Compare the outputs.

Expected behaviour

On the Java client, /help is correctly aliased to Essentials' /ehelp: image

Screenshots / Videos

On the Bedrock client, /help outputs the vanilla list of commands, as in singleplayer: image

Server Version and Plugins

Server is running Waterfall (see dump).

This server is running Purpur version git-Purpur-1402 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: b1810bb on ver/1.17.1) Plugins (20): AsyncWorldEdit, AutomatedCrafting, Chunky, Essentials, ExtraContexts, HolographicDisplays, HopperFilter, IllegalStack, LuckPerms, PlaceholderAPI, PlotSquared, ProtocolLib, ServerUtils, TAB-BukkitBridge, Vault, VentureChat, WorldEdit, WorldGuard, floodgate and spark

Geyser Dump

https://dump.geysermc.org/EjeQ2c6QEfsFyzVH2swPoMXF2mUq8PCk

Geyser Version

1.4.3-SNAPSHOT (git-master-e108527)

Minecraft: Bedrock Edition Version

1.17.10 (Windows 10)

Additional Context

No response

TheMonBonGH commented 3 years ago

I'm sure this is fully client sided, nothing Geyser can do.

Camotoy commented 3 years ago

It's not. On a vanilla server, its help menu appears correctly.

YHDiamond commented 2 years ago

It's not. On a vanilla server, its help menu appears correctly.

Is there something that is preventing this command from passing through to the java server?

420noscope-exe commented 7 months ago

I found a fix for this. An extra help command needs to be added for bedrock players to use (for example /helpbedrock). My code uses the chat() method to force send /help to the server.

https://github.com/GeyserMC/Geyser/issues/4478#issuecomment-1979664116

package bedrockhelpgeyser.noscope420;

import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class HelpBedrock implements CommandExecutor{

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
    {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            if(args.length == 0)
            {
                player.chat("/help");
            }
            if(args.length == 1)
            {
                player.chat("/help " + args[0]);
            }
        }

        return true;
    }

}
Kas-tle commented 7 months ago

This should be retested on 1.20.70 given they have added changed some parts of how AvailableCommands works.

420noscope-exe commented 7 months ago

The original issue still persists in 1.20.70/1.20.71 without the workaround.

My plugin was developed on 1.20.62, and has remained in use since. Seems to work fine on 1.20.70/1.20.71.

andrewkm commented 2 months ago

Same issue here, thanks for linking me Camotoy. Will be great when this is fixed! :)

420noscope-exe commented 2 months ago

There's a relatively simple workaround that I provided. Although it's a little silly to add an extra command for bedrock players, there isn't a way for geyser to capture the /help command because the bedrock client captures and responds to the command instead. Maybe I'll make a PR if have time.

andrewkm commented 2 months ago

There's a relatively simple workaround that I provided. Although it's a little silly to add an extra command for bedrock players, there isn't a way for geyser to capture the /help command because the bedrock client captures and responds to the command instead. Maybe I'll make a PR if have time.

I believe @Camotoy does actually have a way to fix this, as he recently mentioned to me; unless I totally misunderstood.

Camotoy commented 2 months ago

Latest commit should fix the issue without a workaround.

andrewkm commented 2 months ago

Latest commit should fix the issue without a workaround.

Looks to still be broken for us and using the minecraft /help instead.