32 lines
1.1 KiB
Java
32 lines
1.1 KiB
Java
package party._2a03.mc.command;
|
|
|
|
import com.mojang.brigadier.CommandDispatcher;
|
|
import net.minecraft.server.command.CommandManager;
|
|
import net.minecraft.server.command.ServerCommandSource;
|
|
import net.minecraft.server.network.ServerPlayerEntity;
|
|
import net.minecraft.text.LiteralText;
|
|
import party._2a03.mc.util.Config;
|
|
|
|
public class FlyCommand {
|
|
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
|
|
dispatcher.register(CommandManager.literal("fly").executes(ctx -> {
|
|
ServerCommandSource source = ctx.getSource();
|
|
//if (Config.getBool("disableFlyCommand")) {
|
|
source.sendFeedback(new LiteralText("The /fly command is disabled"), true);
|
|
return 0;
|
|
/*}
|
|
ServerPlayerEntity sender = source.getPlayer();
|
|
boolean flight = sender.abilities.allowFlying;
|
|
sender.abilities.allowFlying = !flight;
|
|
if (!flight)
|
|
source.sendFeedback(new LiteralText("I wanna fly like an eagle... to the sea!"), true);
|
|
else {
|
|
source.sendFeedback(new LiteralText("Flight disabled"), true);
|
|
sender.abilities.flying = false;
|
|
}
|
|
sender.sendAbilitiesUpdate();
|
|
return 1;*/
|
|
}));
|
|
}
|
|
}
|