The usual macro for the /hub command bind. Management: just click on / and everything will be written for you emae Macro for servers with mini games and so the macro is suitable for both the Java version and Minecraft Bedrock
Download the program (Download) and go to the macro editor
press the button «Open file»
and select the downloaded file
assign a macro to a key and run the program