+ * Command source types can be anything that extend
+ * {@link CommandSource}, such as {@link GeyserConnection}.
+ * This will guarantee that the source used in the executor
+ * is an instance of this source.
+ *
+ * @param sourceType the source type
+ * @return the builder
+ */
+ Builder
+ *
+ *
+ * The reason is that {@link MinecraftServer#getPort()} doesn't return the LAN port if it's the integrated server,
+ * and changing the behavior of this method via a mixin should be avoided as it could have unexpected consequences.
+ *
+ * @return The server port.
+ */
+ int geyser$getServerPort();
+}
diff --git a/bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/FabricCommandSender.java b/bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/FabricCommandSender.java
new file mode 100644
index 000000000..5973e04f1
--- /dev/null
+++ b/bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/FabricCommandSender.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * @author GeyserMC
+ * @link https://github.com/GeyserMC/Geyser
+ */
+
+package org.geysermc.geyser.platform.fabric.command;
+
+import me.lucko.fabric.api.permissions.v0.Permissions;
+import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
+import net.minecraft.commands.CommandSourceStack;
+import net.minecraft.network.chat.Component;
+import net.minecraft.server.level.ServerPlayer;
+import org.geysermc.geyser.GeyserImpl;
+import org.geysermc.geyser.command.GeyserCommandSource;
+import org.geysermc.geyser.text.ChatColor;
+
+import javax.annotation.Nonnull;
+
+public class FabricCommandSender implements GeyserCommandSource {
+
+ private final CommandSourceStack source;
+
+ public FabricCommandSender(CommandSourceStack source) {
+ this.source = source;
+ }
+
+ @Override
+ public String name() {
+ return source.getTextName();
+ }
+
+ @Override
+ public void sendMessage(@Nonnull String message) {
+ if (source.getEntity() instanceof ServerPlayer) {
+ ((ServerPlayer) source.getEntity()).displayClientMessage(Component.literal(message), false);
+ } else {
+ GeyserImpl.getInstance().getLogger().info(ChatColor.toANSI(message + ChatColor.RESET));
+ }
+ }
+
+ @Override
+ public void sendMessage(net.kyori.adventure.text.Component message) {
+ if (source.getEntity() instanceof ServerPlayer player) {
+ String decoded = GsonComponentSerializer.gson().serialize(message);
+ player.displayClientMessage(Component.Serializer.fromJson(decoded), false);
+ return;
+ }
+ GeyserCommandSource.super.sendMessage(message);
+ }
+
+ @Override
+ public boolean isConsole() {
+ return !(source.getEntity() instanceof ServerPlayer);
+ }
+
+ @Override
+ public boolean hasPermission(String permission) {
+ return Permissions.check(source, permission);
+ }
+}
diff --git a/bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/GeyserFabricCommandExecutor.java b/bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/GeyserFabricCommandExecutor.java
new file mode 100644
index 000000000..7600e4136
--- /dev/null
+++ b/bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/GeyserFabricCommandExecutor.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * @author GeyserMC
+ * @link https://github.com/GeyserMC/Geyser
+ */
+
+package org.geysermc.geyser.platform.fabric.command;
+
+import com.mojang.brigadier.Command;
+import com.mojang.brigadier.context.CommandContext;
+import me.lucko.fabric.api.permissions.v0.Permissions;
+import net.minecraft.commands.CommandSourceStack;
+import org.geysermc.geyser.GeyserImpl;
+import org.geysermc.geyser.command.GeyserCommand;
+import org.geysermc.geyser.command.GeyserCommandExecutor;
+import org.geysermc.geyser.platform.fabric.GeyserFabricMod;
+import org.geysermc.geyser.session.GeyserSession;
+import org.geysermc.geyser.text.ChatColor;
+import org.geysermc.geyser.text.GeyserLocale;
+
+import java.util.Collections;
+
+public class GeyserFabricCommandExecutor extends GeyserCommandExecutor implements Command