A powerful Hytale plugin library for creating, managing, and orchestrating temporary worlds with ease. Bridge provides a robust API for handling world lifecycle, player transfers, and customizable world behavior.
- Easy World Management: Create, activate, deactivate, and delete worlds with simple API calls
- Player Transfers: Safely move players between worlds with built-in thread safety
- Custom World Behavior: Extend
BridgeWorldComponentto add custom logic to your worlds - Asynchronous Operations: Most operations run asynchronously with optional callbacks
- World Configuration: Control block breaking, placement, gathering, and PvP settings
- Lifecycle Events: Hook into world creation, deletion, and player events
- Download the latest Bridge jar from the releases page
- Place it in your Hytale server's
pluginsfolder - Add Bridge as a dependency in your plugin's build configuration
The primary entry point for world management operations. All methods are static and thread-safe.
// Create a new world
BridgeWorldManager.createWorld("arena", new ArenaComponent(), world -> {
// World is ready!
});
// Get all managed worlds
Collection<BridgeWorld> worlds = BridgeWorldManager.getAllVBridgeWorlds();
// Get the default world
BridgeWorld defaultWorld = BridgeWorldManager.getDefaultWorldAsBridgeWorld();Represents a managed world with enhanced functionality.
// Activate a world (load into memory)
bridgeWorld.activate(world -> {
// World is now active and ready for players
});
// Transfer a player to this world
bridgeWorld.transferPlayer(playerRef);
// Configure world settings
bridgeWorld.setAllowPvP(true);
bridgeWorld.setAllowBlockBreaking(false);
// Deactivate world (unload from memory)
bridgeWorld.deactivate();Base class for creating custom world behavior. Extend this to add game logic to your worlds.
public class ArenaComponent extends BridgeWorldComponent {
@Override
public void onPlayerJoinWorld(BridgeWorld bWorld, PlayerRef playerRef) {
// Give players arena gear when they join
giveArenaKit(playerRef);
}
@Override
public void onTick(BridgeWorld bWorld, float deltaTime) {
// Run arena logic every tick
updateArenaGameState();
}
}public class ArenaManager {
private BridgeWorld arenaWorld;
public void setupArena() {
// Create arena world with custom component
BridgeWorldManager.createWorld("tournament-arena", new ArenaComponent(), world -> {
arenaWorld = world;
arenaWorld.setAllowPvP(true);
arenaWorld.setAllowBlockBreaking(false);
arenaWorld.activate();
});
}
public void teleportPlayersToArena(List<PlayerRef> players) {
if (arenaWorld != null && arenaWorld.active) {
for (PlayerRef player : players) {
arenaWorld.transferPlayer(player);
}
}
}
}public class MiniGameWorld extends BridgeWorldComponent {
private int gameTimer = 300; // 5 minutes
@Override
public void onCreateWorld(BridgeWorld bWorld) {
// Initialize game state
setupGame();
}
@Override
public void onTick(BridgeWorld bWorld, float deltaTime) {
gameTimer -= deltaTime;
if (gameTimer <= 0) {
endGame(bWorld);
}
}
@Override
public void onDeleteWorld(BridgeWorld bWorld) {
// Clean up resources
cleanupGame();
}
}createWorld(String name, BridgeWorldComponent component, Consumer<BridgeWorld> callback)getAllVBridgeWorlds()- Get all managed worldsgetDefaultWorldAsBridgeWorld()- Get the default worlddeleteWorld(BridgeWorld world)- Permanently delete a worldactivateWorld(BridgeWorld world, Consumer<BridgeWorld> callback)deactivateWorld(BridgeWorld world, World movePlayersTo)
activate(Consumer<BridgeWorld> callback)- Load world into memorydeactivate(World movePlayersTo)- Unload worldtransferPlayer(PlayerRef player)- Move player to this worlddelete()- Delete this world and its filessetAllowPvP(boolean enabled)- Toggle PvPsetAllowBlockBreaking(boolean enabled)- Toggle block breaking
onCreateWorld(BridgeWorld world)- When world is createdonDeleteWorld(BridgeWorld world)- Before world deletiononPlayerJoinWorld(BridgeWorld world, PlayerRef player)onPlayerLeaveWorld(BridgeWorld world, PlayerRef player)onPlayerDieInWorld(BridgeWorld world, PlayerRef player)onTick(BridgeWorld world, float deltaTime)- Called every tick
- Only activate worlds when needed: Worlds consume memory while active
- Implement onTick efficiently: Keep tick logic lightweight
- Use callbacks for async operations: Don't block the main thread
- Clean up in onDeleteWorld: Release any external resources
- Deactivate unused worlds: Free up server resources
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Found a bug or have a feature request? Please open an issue on the GitHub repository.
Bridge - Simplifying Hytale world management, one world at a time.