package eu.mhsl.minenet.minigames.command.privileged;

import eu.mhsl.minenet.minigames.command.PrivilegedCommand;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.entity.Player;

public class FlyCommand extends PrivilegedCommand {
    public FlyCommand() {
        super("fly");

        setDefaultExecutor((sender, context) -> {
            Player p = (Player) sender;
            p.setVelocity(new Vec(0, 5, 0));
            p.setFlying(!p.isFlying());
            p.setAllowFlying(!p.isAllowFlying());
        });
    }
}
