LobbyGames ✅ High Quality Minigames ⭕ 100% Customizable ⚡ Increase Player Retention

MC Plugin LobbyGames ✅ High Quality Minigames ⭕ 100% Customizable ⚡ Increase Player Retention 2.3.0
Create Pool Tables, Soccer / Football, Connect 4, Snake, 2048, Minesweeper, Tic Tac Toe, and more!

- You can now configure the snake game to use a custom material for the snake! This update also adds the ability to make the first block (the head) be a different type.
This update adds 2 lines to the config, under the existing snake section:
Code:
snake: #add this to the existing section, don't create a new section
  head-material: "WHITE_CONCRETE"
  body-material: "WHITE_WOOL"
- Fixed a bug that was happening on some servers where the soccer ball would despawn when the game started.
- Fixed an issue where the fireworks displayed on a soccer/football goal were too low, they should now be more visible
- There is no longer a quit confirmation when a player clicks the arrow item when waiting for a soccer/football game to start, it will just teleport them to the arena's spawn.
- Fixed an exception that was occurring with /lg reload in the condition that use-display-names was false in the config and if it tried to load an invalid UUID for a leader board.
- Added a way to completely customize the soccer ball through the API. More ways will be built into the plugin in the future, but for now, this gives administrators the ability to code something custom. This API also allows for there to be multiple entities associated with the soccer ball.
Code:
public interface SoccerBallEntity {
  
    /**
     * LobbyGames soccer ball size from config
     * @param size
     */
    public void setSize(int size);
  
    /**
     * Used for spawning and respawning.
     * The game will also respawn the ball when if an entity with a UUID in the UUID set is killed
     * @param loc
     */
    public void spawn(Location loc);
  
    public void teleport(Location loc);
  
    public void remove();
  
    public boolean isValid();

    public boolean containsUUID(UUID u);
  
    public Location getLocation();
  
    public World getWorld();
  
    /**
     * In some advanced use cases, the ball may need a manual check for when a player punches it (ex. block displays).
     * This is initialized by the Soccer game during its initialization
     * @param consumer
     */
    public void setClickConsumer(Consumer<Player> consumer);

}
Example for how the Slime is implemented with this interface:
Code:
public class SlimeSoccerBall implements SoccerBallEntity {
  
    private Slime slime;
    private int size = 3;
  
    public void spawn(Location loc) {
        remove();
        slime = loc.getWorld().spawn(loc, Slime.class);
        slime.setSize(size);
        slime.setAI(false);
    }

    public void teleport(Location loc) {
        slime.teleport(loc);
    }

    public void remove() {
        if (slime != null) slime.remove();
    }

    public boolean isValid() {
        return slime != null && !slime.isValid();
    }

    public boolean containsUUID(UUID u) {
        return slime.getUniqueId().equals(u);
    }

    public Location getLocation() {
        return slime.getLocation();
    }

    public World getWorld() {
        return slime.getWorld();
    }

    public void setSize(int size) {
        this.size = size;
        if (slime != null) slime.setSize(size);
    }

    public void setClickConsumer(Consumer<Player> consumer) {
        // some use cases (ex. block displays) may require a manual way to detect when the player punches the ball
    }
  
}
The custom soccer ball entity can be used via Soccer::setSoccerBallEntity or via the constructor Soccer(LobbyGames plugin, Arena arena, Player p1, SoccerBallEntity ballEntity).
- Set all armor stands spawned by the plugin to have NoAI, this might help with preventing interference from other plugins.
- You can now disable the /lg join sub-command in the config. This is helpful if players should only be able to join a lobby game through something like a GUI (where the console will run /lgjoinplayer) or through clickable signs.
- You can now disable the alias commands, such as /pool, /2048, etc. However, it is not possible to prevent the commands from tab-completing even if they are disabled.
- The /lgjoinplayer command will no longer prevent a player from teleporting to a different world if interworld-teleportation-enabled is false in the config.
- Fixed a bug in pool where the click cooldown was incorrectly applied to both players.

Added these lines to the config:
Code:
lg-join-command-enabled: true #without /lg join, players can only join via the console running /lgjoinplayer or via clickable signs
alias-commands-enabled: true #whether /soccer, /2048, /snake, etc. should be enabled
- Fixed a bug where it could be possible for spectators to not be properly removed when a game such as soccer or spleef completed.
- Made performance improvements to the MySQL system allowing it to offload more work to asynchronous threads.
- Made the default leaderboard-entry-expiration -1 in the default config for no expiration by default.
- Added asynchronous functions to the LobbyGames API to specify clearly whether a player stats query should run synchronously or asynchronously. Note that PlaceholderAPI integration must run a synchronous query when there is a cache miss.
- You can now set environment variables for the MySQL data that will take precedence over the config values. This is a more secure alternative than putting credentials in the config file. The plugin will log that it used environment variables on startup if they are set up correctly.
Code:
LOBBYGAMES_MYSQL_HOST
LOBBYGAMES_MYSQL_USERNAME
LOBBYGAMES_MYSQL_PASSWORD
LOBBYGAMES_MYSQL_NAME
- Completely revamped how rewards and console commands are handled after a game completes. There will now be a rewards.yml in the plugin folder, which allows for much more flexibility in configuring which commands should run when. New features include being able to give a reward to a player only once, give a reward on the condition of a maximum or minimum score, and more options for multiplayer games. PlaceholderAPI is supported in the command strings. The legacy commands set in config.yml will continue to be supported as well, but these offer far fewer capabilities.
Code:
#----------------------------------------------------------------------------------------------------------------------#
#
#  This is the LobbyGames rewards file. Use this to configure how games will handle running
#  commands after a player finishes a game.
#
#----------------------------------------------------------------------------------------------------------------------#

snake:
  any-reward-name-here:
    enabled: false
    min-score: 40
    console-commands:
      - "broadcast &2&l%player%&a got a score of %score% in snake!"
      - "eco give %player% 10000"
  first-time-reward-example:
    enabled: false
    one-time: true #A player can only ever get this reward once with this option
    msg: "&bYou completed your first snake game!"
    console-commands:
      - "eco give %player% 100"

pool:
  simple-multiplayer-example:
    enabled: false
    for-winning-player: true #only give this reward for the player who won (default is false)
    console-commands:
      - "eco give %player% 100"

soccer:
  teleport-to-spawn-example:
    enabled: false
    per-player: true #'true' runs this command for each player in the game when the game ends (default)
    run-on-quit: true #if the reward/command should be given every time the player leaves the game, even if it has not started (ex. for teleporting player back to spawn)
    console-commands:
      - "minecraft:tp %player% 100 100 100 0 0"
  no-per-player-example:
    enabled: false
    per-player: false #run once when the game ends instead of for every player. Can not use %player% when this is set to false
    console-commands:
      - "broadcast &b%winners% won against %losers% in Soccer!"

2048:
clicker:
connect4:
minesweeper:
spleef:
sudoku:
tictactoe:
- All leader boards will periodically check for name updates on their entries. If you have use-display-names set to true, the player must be online for it to know that their rank or name prefix has changed.
- Fixed a small bug regarding how leader boards are configured with the use-display-names option. When set to true, this option will use the player's tab list name on leader board entries. When false, it will use their normal name.
- Updated the links in the wiki. The old link will continue to redirect to the same page.
New Wiki Link: https://github.com/Unfaxed/lobbygames_wiki/wiki/Getting-Started
Top Bottom