GithubHelp home page GithubHelp logo

bedwars's Introduction

GitHub stars Lines of code GitHub License CodeFactor Grade

Bedwars

© 2024 CMarco
Version 3

Introduction

This software implements the famous Bedwars game-mode into your Minecraft servers. It has been originally created solely by CMarco in 2021 for SpigotMC version 1.8.8 and has now been recoded and revised to support the latest versions.

Requirements

This software, in its latest version, has several requirements that the customer must comply with in order to use it without errors and to receive proper support from us.

Java Requirements This software has been compiled with Java 17 (Eclipse Temurin) and is using features and syntax improvements specific to this version of Java. Therefore, it is a mandatory requirement for you to use any version of Java at least matching ours.

Database Requirements This software requires a database server in order to work properly. Through a database we are able to save player experience, total wins, tasks and lobby managers. A connection to a MySQL compatible database is necessary. Additional support for SQLite and PostgreSQL will be brought soon.

SpigotMC Server Requirements This software has been compiled with version 1.18.2 of SpigotMC API. The result of this choice is that you may currently only run this software on servers having version between 1.18 and 1.20. Having said this, we want to make notice of the possible incompatibilities that you may encounter when not using SpigotMC server software. We do not have enough resources and physical time to test this plugin on all the forks that are available out there ( Paper, Purpur, Pufferfish, etc. ). We therefore state, right here, that you may not be entitled to receive support when using Bedwars outside of the SpigotMC server environment, and that we officially do not provide compatibility with Folia.

Intended Use

This server is intended to be used in a network with more server instances, or in a single server that only runs Bedwars within the same instance. It can work within a multi-world single-server environment, but it is not recommended or tested.

Bedwars Setup

The first step of our setup will be to run our jar for the first time. Simply place the Bedwars jar in your server plugins/ folder and start the server. When you will start your server with our plugin jar in it for the first time, you should get a error in your console a connection to the database could not be established. You may now shutdown your server and start configuring your database.

Configuring the Database After having started your plugin for the first time, it will have generated all the necessary

configuration files for you to start using it. Please, make sure that while you are configuring it your server is not active. To configure the database, you need to open the config.yml file in the “plugins/Bedwars/” folder.

Server Settings Server Name and Domain

server-name: "&eMyServer"
server-domain: "server.net"

Set the server-name to the desired name for your Bedwars server. You may use color codes and Minecraft formatting with the ‘&’ character. That server name will be used in some messages sent to the user during his gameplay as a prefix. Additionally, specify the server- domain ( the same one your players are connecting to ) with the appropriate domain or IPv4 for your server.

Database Configuration

database:
username: "user"
password: "password"
address: "127.0.0.1"
port: 3306
db-name: "bedwars"

Configure the database connection details as follows:

username: Your database username. password: Your database password. address: The IP address of your database server. port: The port on which your database server is running ( MySQL default is 3306 ). db-name: Set the name of the database our plugin will store data into.

Lobby and Gamemodes Configuration

lobby:
world-name: "world"
attempt-load:
  - "solo"
  - "duo"
  - "quad"

Setup the world-name parameter for the lobby by specifying its world name. The server will attempt to send the players to that world when they finish a mini-game or quit a matchmaking. Define the different game modes you want to enable by listing them under attempt-load. In the example above, solo, duo, and quad modes are configured, and will therefore be loaded at server startup. We will later define how to setup game modes and their relative maps.

Configuring Game Mode Maps

This plugin works with a real-time maps loading system, which is a mechanism we have invented and implemented from scratch for this software. This plugin will automatically find out folders in the data folder of this plugin, and load them. Each folder represents a Bedwars map, with all of its configurations, settings and setup. Each single game mode map is fully configurable and custom, starting from its shops to its teams and game

modes. This particular style of setup requires a lot of initial configuration, but it is overall extremely efficient in providing a fully modifiable environment for each map.

By default, this software will attempt to generate a “sample-game” folder, with all the following configurations:

  • general.yml
  • beds.yml
  • merchants.yml
  • shop.yml
  • spawners.yml
  • spawns.yml
  • teams.yml
  • upgrades.yml

Here below you will receive a detailed explaination for each of the configs necessary to set up an individual Bedwars gamemode.

General

map-filename: "bedwars-solo"
gamemode: 'solo'

The map filename value represents the Minecraft map that the game should attempt to load for this configuration. The world map should, for your own benefit and performance, be a void type world. Using a void type world will guarantee you to have very fast loading times and low impact on your server memory usage. This world map should be server-compatible type for SpigotMC servers and should be exclusively placed, inside each defined gamemode root folder.

Example of correct world folder placement: “my-server-folder/plugins/Bedwars/sample-game/bedwars-solo-map/”

When you bought this plugin, you will receive a pre-configured map named ‘Glacier’. All the values of the pregenerated configurations are already perfectly compatible with that map. Feel free to try the plugin and place the map folder in the following place: “my-server-folder/plugins/Bedwars/sample-game/Glacier/”

After having taken that into consideration, you may change the gamemode parameter according to the game-mode that will be played on this very same map. The possible values are: “solo”, “duo” and “quad”.

Game Parameters

start-timer: 15
minimum-games: 4
maximum-games: 16
min-players: 2
players: 4
deathmatch-start: 1800 # in seconds
tnt-fuse: 75 # in ticks (20 tick = 1s)

“start-timer” indicates the time, in seconds, that the game will take to start upon having enough players. The ticking sound and countdown animation will play during these seconds.

“minimum-games” indicates the minimum amount of games that will be allocated using this map. Each game will have a unique world and it will be loaded at runtime. The server will never attempt to unload worlds below this value. A recommended value is one for small servers, four otherwise.

“maximum-games” indicates the maximum amount of games that will be allocated using this map. If the maximum amount is reached, the players will have to wait for a game to finish in order to join this map.

“min-players” describes the minimum amount of players required for this game. Note that you shouldn’t put values below the game-mode specific threshold. A “solo” game-mode will require at least two players (one per team), a “duo” game-mode will require at least four players (two per team) and a “quad” will require at least eight players (four per team). Solo can be any value, whilst duo and quad must be multiples of two.

“players” the total amount of players that can play in this game-mode. Again, set this value keeping in mind the restrictions from the game-mode you have chosen. Solo can be any value > 2, whilst duo and quad must respectively be multiples of two and four.

“deathmatch-start” indicates after how many seconds should the game turn into a deathmatch scenario. This will mean that player will no longer be able to respawn, and ender dragons can spawn. The last team standing will win. This is necessary to not have games taking too much time.

tnt-fuse” estabilishes after how many ticks TNTs explode.

Spawn parameters

spawn-protection:
  x: 8.00 # These values correspond to the
  y: 3.00 # minimum distance that a block has to be
  z: 8.00 # distant from the set spawn position.
map-lobby-spawn:
  x: -290.0 #Please modify this
  y: 111.0 #Please modify this
  z: 0.0 #Please modify this

“spawn-protection” indicates the area of protection for the queue lobby of this gamemode map. This is due to the fact that each map must have a queue area inside it. The ‘x’, ‘y’ and ‘z’ values of this element indicate the maximum distance of block protection, on each individual axis, that this plugin will provide to the part of the map centered around the map-lobby-spawn coordinates. You can imagine this as a parallelepiped, centered around “map-lobby-spawn” coordinates, with sides 2x, 2y and 2z. It is recommended to exceed, if possible, with the protection values, to avoid fatal misconfigurations, causing the users to grief this map.

“map-lobby-spawn” gives the coordinates of the spawn for this game map. The players will wait here during the matchmaking phase. Players are free to leave this lobby either through commands /bedwars quit, or by disconnecting.

Beds

beds-locations:
- x: -80.5 #Pink
  y: 62.5
  z: 38.5
  team: "PINK"

Inside the beds.yml configuration file, you will find a list of locations, accompanied by their respective team. These entries represent the locations of the bed of each team, which must be set accurately. The location of the bed should be set to the any of the two blocks occupied by the bed, it is indifferent. However, it is fundamental that the prebuilt maps includes the bed block! This location is fundamental as it will be used to check for team bed being destroyed or attacked. The possible team colors for the team parameter are: "CYAN”, "PINK", "YELLOW", "GREEN", "RED", "BLUE", "WHITE", "GREY". You are required to assign as many team beds as for each team defined in the teams.yml file.

Teams

Inside the teams.yml configuration file you will find a list of teams defined for this game. As previously defined, there are eight different predefined teams, and you may not add different ones. However, you are free to remove them or change the colors if you don’t wish to have them in this map. Remember that it is mandatory for at least two teams to be defined in a configuration file. A game is not possible with less than two teams, no matter the game-mode.

Spawns

map-spawns:
- x: -93.0 # Please set this accordingly to map
  y: 62.0 # Please set this accordingly to map
  z: -37.0 # Please set this accordingly to map
  team: "GREY" # The team

Within the spawns.yml configuration file you will be able to define the individual spawn point for each defined team.

Remember to set correctly the spawn point for each team. A team that has been defined cannot miss a spawn point, it will cause errors.

Upgrades

The upgrades.yml configuration file defines the upgrades that can be bought from the shop, such as enchantments, boosting effects, spawner upgrades, and so on. Each upgrade is already defined, and is already working, but you are free to make modifications.

Existing Upgrades

Sharpness This upgrade allows you to give sharpness to the team users. It will automatically apply to all swords and axes bought by all the team players.

Reinforced Armor This upgrade has multiple levels. Each level will give the team a further value of protection for all their armor pieces. Protection enchantment will be automatically applied on all pieces, including the one that have been bought previous to this upgrade.

Maniac Miner This upgrade gives the Haste effect to the entire team. It will increase their mining speed through the entire map, making them able to destroy the enemies blocks and bed faster. It has two levels.

Iron Forge This upgrade improves the efficiency of production of all the team island spawner. It has four levels, and each will increase the improvement by 50% up to a maximum of 200%.

Heal Pool Heal pool is an upgrade that creates a health regeneration field, with a spiral animation, around the base spawn location.

Dragon Buff This feature will spawn two dragons for your team if the game reaches its death-match stage. This will improve the chances of the enemy player being killed by dragons.

Traps There are several traps that the team can buy. These are purchases that have a single use, and will be activated when an enemy enters an area close enough to the team’s bed. More than one trap may be purchased, and they will all activate at once.

Alarm Trap When an enemy player reaches a distance close enough to the team bed, all team players will be alerted by sounds and text.

Blindness Poison This trap causes the enemy to shortly be affected by blindness and poison effect upon entering the team base.

Counter Offensive This trap gives all the team players a boost, they will be able to damage the invading enemies better thanks to the short speed and strength potion effect.

Miner Fatigue Invading enemies will get miner fatigue, their mining speed will therefore be reduced, making it more difficult for them to destroy the team bed.

Spawners

spawners:
    # EMERALD SPAWNERS
    - type: "EMERALD"
      invisible: false
      location:
      x: 26.5
      y: 72.5
      z: -25.5
      drop-amount: 1
      drop-delay: 180 # in seconds
      levels:
      - number: 1
        increase-drop: 0
        after-seconds: 1
        decrease-delay: 0
      - number: 2
        increase-drop: 0
        after-seconds: 720
        decrease-delay: 40
      - number: 3
        increase-drop: 1
        after-seconds: 1440
        decrease-delay: 60

Spawners are an essential part of the Bedwars game. They automatically drop resources on the ground, making players able to buy better tools, weapons and upgrades. Each team will have their local iron and gold spawners within their island, but there will also be emerald and diamond spawners in other places of the map, usually near the center, which can be more contended and players may have to fight to get those resources.

Here will follow an explanation of the spawner parameters:

type This is the type of the resources spawned by this spawner. The available options are: IRON, GOLD, EMERALD and DIAMOND.

invisible This setting will determine whether there should be a spawner model with animation in the location where the resources are dropped, or if the resources should simply spawn on the ground.

location The location where this spawner will be generated.

drop-amount This is the amount of resources that will be dropped on the ground on each cycle.

drop-delay This is the amount of seconds that will pass between each resource being dropped.

number This represents the number of the level.

increase-drop This parameter determines how many drops should be added after the spawner has reached this level. This value can be set to 0 to leave it unaffected.

after-seconds This value determines after how many seconds the game has started the spawner should reach this level. The first level should usually be set to 1 second.

decrease-delay This value decreases the spawn-rate by a given amount of seconds upon reaching the level. It can be set to 0 to leave it unaffected.

You may define as many spawners as you wish in your map, as long as they’re properly configured.

Merchants

merchants:
# MERCHANTS SHOP SIGNS
- name: "§7[§eBedwars§7] §eShop"
  type: "SHOP"
  location:
    x: 33.5 # Please set this
    y: 62.0 # Please set this
    z: -93.0 # Please set this

The Bedwars game is characterized by the presence of villager merchants for each of the teams islands. Two separate villagers are used, one for the shop and another for upgrades purchases.

Inside the merchants.yml configuration file you will be able to define the exact location where you want your villagers to be located for each team island. You will have to configure two villagers for each team.

type This represents the type of merchant that will be assigned to the villager. Options are SHOP and UPGRADE.

location The location of the villager for this shop. Needs to be exact and located at the villager position.

Shop

This section will cover the shop.yml configuration file, which is essential to configure which items are for sale on the SHOP merchant.

1. Understanding the Structure:

  • The file is divided into sections such as shop, glass, upgradable-items, items, and potions. Each section serves a specific purpose in defining the SHOP's offerings. 2. Title and Slots:
  • Set the title of your SHOP using the title parameter. Use "{TEAM}" as a placeholder for the team name.
  • Define the number of slots available in the SHOP using the slots parameter (e.g., 54 slots). 3. Glass Slots:
  • Customize the appearance of certain slots with glass using the glass section.
  • Specify the glass color using the color parameter and designate slots for glass using the slots list.

4. Upgradable Items: Upgradable items are items that can be upgraded, by buying their successive option. They increasingly get better, but they also get downgraded when the players dies. They may only get downgraded to the first level after they having been bought. The player will never lose possession of the first level upgradable item.

  • Add upgradable items by populating the upgradable-items section.
  • For each item, specify the slot number, shop category, amount, and different upgrade levels.
  • Include details such as material, item name, currency for purchase, price, lore, and enchantments. 5. Regular Items:
  • Define standard items available for purchase in the items section.
  • For each item, specify material, shop category, item name, slot, amount, currency, price, and lore. 6. Potions:
  • Customize potions available in the SHOP by populating the potions section.
  • Include details such as potion name, slot, amount, currency, price, lore, potion type, duration, and level.

Commands

/bedwars join (Permission: bedwars.users.join) This command is used by any player to join a gamemode. The gamemode parameter may only be “solo”, “duo” and “quad”. He will be sent to the first matchmaking available, or will be printed an error message if the game is not available.

/bedwars set (Permission: bedwars.admin.use) This command is used by an administrator to setup a matchmaking queue villager. By running this command while directly looking at a villager, that villager will be stored into a database and will be turned into a matchmaking tool. Any player will be able to click on that villager to start matchmaking the assigned gamemode.

/bedwars quit (Permission: bedwars.users.quit) This commands makes the player quit the bedwars game or matchmaking.

/bedwars exp (Permission: bedwars.users.exp) This command will print out the experience and level that the user has reached. Experience will accumulate from different situations, such as winning games, playing games and being online.

/bedwars exp view (Permission: bedwars.admin.exp.view) This command can be used to view someone else experience points.

/bedwars exp add (Permission: bedwars.admin.exp.give) This command can be used by an administrator to increase a player experience points.

Database Specifications

This software uses the MySQL database on several occasions. In this section of the document we will specify which features are stored and available from the Bedwars database data.

global_stats This table stores all the necessary information associated to the kills and wins performed by each player. This table contains player wins for solo, duo, quad game-mode, kills counter for solo, duo and quad, and final kills counter for solo, duo and duo. Final kills are a separate type of kill, achieved when the player kills an enemy that doesn’t have a bed, effectively making him lose the game.

data_reset This table is used for internal purposes only. It stores counters for the automatic cleanup of daily and weekly achievements. Touching this is not recommended.

daily_quests_data This table is used to store the daily quests data for each individual player. It is part of the quest system used by Bedwars plugin. It will store the games won by the players and the amount of games played.

weekly_quests_data This table is used to store the weekly quests data for each individual player. It is part of the quest system used by Bedwars plugin. It will store the total amount of beds broken by this player.

queue_villagers This table is used to store the villagers that can perform matchmaking. It is used internally by the software, touching this is not recommended.

ranks This table is used to store the experience (rank) of the player. Experience is achieved through winning and completing quests.

Experience System This plugin includes a built-in experience system that can be used by players and administrators to properly reward players playing a lot and showing high winning rates.

Quest System The Experience System of Bedwars includes a Quest System. There are two defined types of quests: daily quests and weekly quests. The player will received a fixed amount of EXP points by completing any of these.

As intended by their name, daily quests may be completed every 24 hours, and weekly quests every 7 days.

Daily Quests

  • 250 EXP for winning the first daily win.
  • 250 EXP for a daily played game.

Weekly Quests

  • 5000 EXP for destroying an enemy bed.

Others

  • 25 EXP for saying “good game” or “gg” towards the end of the game.
  • 25 EXP per minute of bedwars gaming.

Level System The leveling system in our application is designed to provide users with a structured progression based on experience points (XP). Here's an overview:

Level Milestones: The leveling system is organized into milestones, each comprising 100 levels. There are a total of 1000 levels in the system.

Experience Point Requirements: The first four levels have predefined XP requirements: 500 XP for level 1, 1500 XP for level 2, 3500 XP for level 3, and 7000 XP for level 4. For subsequent levels within each milestone, XP requirements are calculated by adding fixed values for each of the first four levels to the XP requirement of the previous level. Remaining Levels:

After the initial four levels, the XP requirement for the remaining levels (from level 5 to level 1000) increases by a fixed amount of 5000 XP per level. This leveling system ensures a gradual increase in XP requirements as users progress, offering a sense of achievement and advancement through the various levels.

PlaceHolder-API Support

This plugin offers a complete support for PlaceHolder-API.

{version} Returns the version of the plugin.

{rank} Returns the player's rank.

{level} Returns the player's level.

{exp_abs} Returns the absolute experience points of the player.

{exp_current_rel}: Returns the current relative experience points of the player.

{exp_required_rel}: Returns the required relative experience points for the current level of the player.

{team_colour}: Returns the team color of the player as a character, according to Minecraft color codes.

{solo_kills}: Returns the solo kills of the player.

{duo_kills}: Returns the duo kills of the player.

{quad_kills}: Returns the quad kills of the player.

{total_kills}: Returns the total kills of the player.

{solo_fkills}: Returns the solo final kills of the player.

{duo_fkills}: Returns the duo final kills of the player.

{quad_fkills}: Returns the quad final kills of the player.

{total_fkills}: Returns the total final kills of the player.

{solo_wins}: Returns the solo wins of the player.

{duo_wins}: Returns the duo wins of the player.

{quad_wins}: Returns the quad wins of the player.

{total_wins}: Returns the total wins of the player.

{top_kill} This is a composite placeholder. It will return player name at nth position according to amount of kills in the specified gamemode. Example: {top_duo_kill_3}, will return 3rd player ranking according to top kills on duo gamemode.

{top_fkill} This is a composite placeholder. It will return player name at nth position according to amount of finals kills in the specified gamemode. Example: {top_solo_fkill_2}, will return 2nd player ranking according to top kills on solo gamemode.

{top_wins} This is a composite placeholder. It will return player name at nth position according to amount of games won on the specified gamemode.

{top_total_wins_} This is a composite placeholder. It will return player name at nth position according to amount of sum of games won on all gamemodes.

{top_level_} This is a composite placeholder. It will return player name at nth position according to the global level rankings.

Bedwars Developer API

This plugin comes with a small events API that other developers may use to interact with Bedwars internals more easily.

These are the events we provide you (some fields may be obfuscated): All the events will be stored in the top.cmarco.bedwars.api package, and all of them will extend the abstract event ActiveGameEvent, which stores as main field the active game (source not available).

Events :

  • AbstractDeatmatchStartEvent (Called when death match mode starts)
  • ActiveGameTerminateEvent (Called when a game is concluded\terminated)
  • BedwarsFriendlyFireEvent (Called upon friendly fire)
  • BedwarsLevelUpEvent (Called when a player levels up)
  • BedwarsPlayerDeathEvent (Called when a player dies)
  • BedwarsPlayerQuitEvent (Called when a player quits the game)
  • ConnectToQueueEvent (Called when the player connects to matchmaking queue)
  • CustomDrinkEvent (Called when the player is given a custom drink)
  • GameStartEvent (Called when a game starts)
  • LeaveQueueEvent (Called when a player leaves the queue)
  • PlayerGoodGameEvent (Called when a player says ‘good game’ or ‘gg’)
  • TeamBedDestroyEvent (Called when a team bed is broken)
  • TeamEliminationEvent (Called when a team is fully eliminated)
  • TeamWinEvent (Called when a team won the game)
  • TrapTriggerEvent (Called when a trap is triggered)

bedwars's People

Contributors

cmarcoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.