Convert Figma logo to code with AI

PaperMC logoVelocity

The modern, next-generation Minecraft server proxy.

1,743
604
1,743
146

Top Related Projects

The modern, next-generation Minecraft server proxy.

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.

Quick Overview

Velocity is a modern, high-performance Minecraft proxy server designed to scale and handle large player networks. It acts as an intermediary between players and backend Minecraft servers, offering features like load balancing, server switching, and enhanced security.

Pros

  • High performance and scalability, capable of handling thousands of concurrent players
  • Modern codebase written in Java, with support for plugins and extensions
  • Robust security features, including anti-bot measures and IP forwarding
  • Seamless server switching and load balancing capabilities

Cons

  • Requires more setup and configuration compared to traditional Minecraft servers
  • May not be necessary for small-scale Minecraft networks
  • Limited compatibility with some Bukkit/Spigot plugins designed for traditional servers
  • Steeper learning curve for server administrators unfamiliar with proxy setups

Code Examples

Here are a few examples of how to interact with Velocity's API in plugins:

  1. Registering a command:
@Command(aliases = "ping", description = "Check your ping")
public class PingCommand implements SimpleCommand {
    @Override
    public void execute(Invocation invocation) {
        Player player = invocation.source();
        player.sendMessage(Component.text("Your ping is " + player.getPing() + "ms"));
    }
}
  1. Listening for player join events:
@Subscribe
public void onPlayerJoin(LoginEvent event) {
    Player player = event.getPlayer();
    player.sendMessage(Component.text("Welcome to the server!"));
}
  1. Switching a player to another server:
public void switchServer(Player player, RegisteredServer targetServer) {
    player.createConnectionRequest(targetServer).fireAndForget();
}

Getting Started

To get started with Velocity:

  1. Download the latest Velocity JAR from the official website.
  2. Create a velocity.toml configuration file in the same directory.
  3. Configure your backend servers in velocity.toml:
[servers]
lobby = "127.0.0.1:25565"
minigames = "127.0.0.1:25566"

[forced-hosts]
"lobby.example.com" = ["lobby"]
"minigames.example.com" = ["minigames"]
  1. Start Velocity using java -Xms1G -Xmx1G -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -jar velocity.jar

  2. Connect to Velocity using the proxy's IP address and port (default 25577).

Competitor Comparisons

The modern, next-generation Minecraft server proxy.

Pros of Velocity

  • High-performance Minecraft proxy server
  • Supports multiple backend servers
  • Extensive plugin API for customization

Cons of Velocity

  • Requires more setup compared to traditional servers
  • May have compatibility issues with some Bukkit/Spigot plugins
  • Learning curve for server administrators unfamiliar with proxy systems

Code Comparison

Velocity configuration example:

servers:
  lobby:
    address: localhost:25565
  survival:
    address: localhost:25566
try:
  - lobby
  - survival

Key Differences

As both repositories refer to the same project (Velocity), there are no significant differences to compare. Velocity is a modern Minecraft proxy server designed to be fast, flexible, and secure. It allows server owners to connect multiple Minecraft servers together, providing a seamless experience for players.

Conclusion

Velocity is a powerful tool for Minecraft server networks, offering improved performance and scalability compared to traditional server setups. While it may require more initial configuration, the benefits in terms of player capacity and server management make it a popular choice for larger Minecraft communities.

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.

Pros of BungeeCord

  • Established and widely used in the Minecraft server community
  • Extensive plugin ecosystem with many available options
  • Supports a broader range of Minecraft versions

Cons of BungeeCord

  • Less performant than Velocity, especially under high load
  • Slower development cycle and less frequent updates
  • Limited modern Java features and optimizations

Code Comparison

BungeeCord:

public void handle(PacketWrapper packet) throws Exception {
    if (packet.packet == null) {
        throw new QuietException("Unexpected packet received during login process!");
    }
    PacketHandler handler = handlers.get(packet.packet.getClass());
    if (handler != null) {
        handler.handle(packet);
    }
}

Velocity:

public CompletableFuture<Boolean> preLogin(PreLoginEvent event) {
    return server.getEventManager().fire(event)
            .thenApply(e -> !e.getResult().isAllowed());
}

The code snippets demonstrate differences in packet handling and event management between the two projects. Velocity's code appears more modern, utilizing CompletableFuture for asynchronous operations, while BungeeCord uses a more traditional approach with exception handling.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Velocity

Build Status Join our Discord

A Minecraft server proxy with unparalleled server support, scalability, and flexibility.

Velocity is licensed under the GPLv3 license.

Goals

  • A codebase that is easy to dive into and consistently follows best practices for Java projects as much as reasonably possible.
  • High performance: handle thousands of players on one proxy.
  • A new, refreshing API built from the ground up to be flexible and powerful whilst avoiding design mistakes and suboptimal designs from other proxies.
  • First-class support for Paper, Sponge, Fabric and Forge. (Other implementations may work, but we make every endeavor to support these server implementations specifically.)

Building

Velocity is built with Gradle. We recommend using the wrapper script (./gradlew) as our CI builds using it.

It is sufficient to run ./gradlew build to run the full build cycle.

Running

Once you've built Velocity, you can copy and run the -all JAR from proxy/build/libs. Velocity will generate a default configuration file and you can configure it from there.

Alternatively, you can get the proxy JAR from the downloads page.