Repository navigation
Home
Nicholas edited this page May 25, 2017
·
6 revisions
(All code here should go in the onEnable() of your main plugin class)
In this tutorial, we'll be creating a simple spleef minigame.
Games require an arena to run in. Create one with Arena(String).
/*
Create an arena object. When created, it will load the world onto the server. If the world exists as a folder, it will be loaded from that; otherwise, a new world is generated. In order to increase the speed of this process, no terrain is generated.
*/
Arena arena = new Arena("Spleef");Game objects are the centerpart of your minigame.
/*
Arguments are (String name, Arena arena, Plugin registeringPlugin);
*/
Game spleef = new Game("Spleef", arena, this);You can customize the Game in many ways, most of which involve disabling/enabling some included features. In this example, even though some of these are enabled by default, I'll be showing them anyway.
spleef.setPrefix("[Spleef]"); //Set the prefix for messages sent to players in the game.
GameSettings gSettings = spleef.getGameSettings(); //Set a variable for accessibility.
gSettings.shouldUseTeams(false); //Since Spleef is a solo minigame, we're disabling automatic features related to teams.
gSettings.setMOTD(true); //This will override the server's MOTD, setting the game status (Ingame, Waiting) to be displayed in the server list.
gSettings.setMaximumPlayers(8);
gSettings.shouldSetPlayerListCount(true); //Set the maximum player count in the server list to the maximum allowed players.