Hi. Like most minigames, you right click a sign to join the lobby, you wait until the set amount of players join the lobby, then the game starts, ends, then your teleported back to lobby. I can handle the game making part, just not the lobby part. It is very confusing for me. Right now, i probably sound like a total noob but, I just want to know, Where would i start?
https://forums.bukkit.org/threads/tut-create-a-minigame-with-arena-names.193908/ But you should learn more java and bukkit api if you are confused. Make a list of what you need, this will help you!
PlayerInteractEvent - use it to detect a sign being clicked Register the required listeners when the game starts, unregister them when the game ends. OR Boolean that reflects if the game is running or not OR Boolean to check the player's location/world
If you are making a mini-game, you would want to run the player.sendMessage(player.getName() + " is so ugly they died.") as a console message. (That is just my opinion, I don't think that a lot of mini-games just send messages to only the player that died... As for help, I couldn't do any better than to say what teej107 said. teej107 GG
Msrules123 you do know thats my signature.... right...? teej107 how do i do playerInteractEvent to a sign with specific chat on the sign? lets say: first line has [Join] second line has The arena name, and third has the number of players in the arena OHQCraft Laxer21117 maybe you guys could help. What i want to do is make a lobby that has signs, you click 1 of the join signs, it teleports you to the game lobby, once there is for example 16 people in that lobby, the game starts. Then the game ends and everybody is teleported back to the server lobby. I know how to do the sign teleporting you to the game lobby but i dont know how to test if there are 16 players in that lobby. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
mkezar Store the value of how many players are currently in the game somewhere. Heck, you probably store the players as they join the game, which would essentially have the value for you.
mkezar Code:java @EventHandler public void onSignClick(PlayerInteractEvent event) { Block block = event.getClickedBlock(); if(block != null) { if(block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) { Sign sign = (Sign)block.getState(); } } } Here is some example code. First you get the block that the player clicks, make sure it isn't null so you won't get a NPE. Then check to see if the block is a sign (there is a difference between signs on walls and signs that are not on walls), if you read this JavaDoc (especially this method) you'll see why you'll need to call the getState() method. Sign has a number of methods that will help you as well.
nono, that's so inefficient. Use this to add Players, definitely don't do it through a command as that is so unpro: Code:java @EventHandler public void onInteract(PlayerInteractEvent event){ if(event.getClickedBlock() instanceof Sign){ Sign clicked = (Sign) event.getClickedBlock(); if(clicked.getLine(0).equals("[Minigame]") && clicked.getLine(1).equals("Arena1")){ //Call your teleport to game function here! } } } For quiting the arena just find out when they die and then teleport them back and remove them from any tracking Lists/Maps. EDIT by Moderator: merged posts, please use the edit button instead of double posting.