Tutorial Make a minigame plugin!

Discussion in 'Resources' started by xTrollxDudex, Aug 15, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    xTrollxDudex

    DailyLove
    Thanks, I'll address the problem as soon as possible :)
     
  2. Offline

    jusjus112

    xTrollxDudex

    Can i make an extra class for the events?
    i will make events so you cant jump or you cant walk

    And is only in the onEnable.
    you must register your events right? Thats is it?
     
  3. Offline

    xTrollxDudex

    jusjus112
    Yeah. You can check if the player isInGame() when listening to events, I suggest you check on player move event each BLOCK and see if the block below them is Material.AIR. Not sure why you don't want anyone to walk, but just check if they are isSprinting() in payer move event.
     
  4. Offline

    jusjus112

    xTrollxDudex
    i will if the game is ended, players cant walk. and what must i do in the onEnable?

    xTrollxDudex

    How do i set an lobby spawnpoint?, and then will in the lobby othere vents as in the game

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 6, 2015
  5. Offline

    xTrollxDudex

    Register your events....
    Okay, I think it's time to deepen your knowledge to java and the Bukkit API now, you can have multiple spawns in your arena object, but teleport to them at different times.

    Updated repo and OP. It should work now :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 6, 2015
  6. Offline

    zakkinu2

    Assist Ok i understand everything finally after 80 something basic java videos... i can basically do it by myself but the only problem is if i were to put the people in an arena in a group and when the group size is 2 or bigger how can i make it so it starts a timer for 30 seconds like a countdown and it works for every separate arena . so if a countdown is going another one can start without interacting with the others. Any ideas? thanks for the tutorial by the way.
     
  7. Offline

    xTrollxDudex

    zakkinu2
    When you do addPlayer(...) you would check the arena player list and see if the size of it is over 2. Then start a Runnable.
     
  8. Offline

    [Cookie]

    Just a quick question. What should my main class file be when I first code a minigame plugin?
     
  9. Offline

    xTrollxDudex

    @[Cookie]
    It should be a normal class unless you happen to have something in mind .
     
  10. Offline

    [Cookie]

    so a normal class would be = everything to be imported and just connect them with other class using listeners?
     
  11. Offline

    xTrollxDudex

    The other classes... Don't need to be registered...
     
  12. Offline

    BotLover

    After looking at your code the reloadArenas() method wont work because you put i as a int but integers aren't applicable for reloadArenas() as you did Location 1
    Code:java
    1. //Line 115
    2. public Arena reloadArena(Location l) {
    3.  
    4. //Line 155
    5. reloadArena(i);
     
  13. Offline

    xTrollxDudex

  14. Offline

    Slideroller

    How would you do the lobby feature and I'm confused where to add the items etc.
     
  15. Offline

    [Cookie]

    oh okay. Thanks:)
     
  16. Offline

    xTrollxDudex

  17. Offline

    BotLover

    btw your commands are also messed up, I suggest testing it yourself before you make a tut :3
     
  18. Offline

    xTrollxDudex

    BotLover
    .....................................................................

    They're not commands -_-
    I suggest learning how to use a tutorial before looking into one :3
     
  19. Offline

    Slideroller

    Like adding stuff for an example when a player joins they join with a gold ingot?
     
  20. Offline

    xTrollxDudex

    Slideroller
    That's not relevant to the main topic of the thread. What you can do however, is actually learn from reading the line comments, which IMO, is very clear in where the player is being added. Add
    PHP:
    p.getInventory().addItem(new ItemStack(Material.GOLD_INGOT));
    In ArenaManager#addPlayer(org.bukkit.entity.Player)
     
  21. Offline

    [Cookie]

    Sorry, but could you give me an example of the main class? Im still having troubles with it :\
     
  22. Offline

    xTrollxDudex

    PHP:
    public class Main extends JavaPlugin {
        public 
    void onEnable() {
            
    //stuff
        
    }

        public 
    void onDisable() {
            
    //stuff
        
    }

        public 
    boolean onCommand(CommandSender senderCommand cmdString labelString[] args) {
            
    //stuff
        
    }
    }
     
  23. Offline

    jusjus112

    xTrollxDudex
    How do i make an command for delete an arena?>
    And another question! If you reload the server. all of the arenas are lost!
    How to fix it?
     
  24. Offline

    xTrollxDudex

    jusjus112
    Take a look on the repository in OP
     
  25. Offline

    jusjus112

  26. Offline

    xTrollxDudex

  27. Offline

    xTrollxDudex

    Updated OP to add headers, and separator to make it look pretty. Includes source at the bottom of the page.

    Edit: THANK YOU FOR TEN THOUSAND VIEWS!
    Thanks for coming and looking at my awesome tutorial everyone :'D
     
  28. Offline

    DarkBladee12

    xTrollxDudex I believe there's no tutorial on how to use a tutorial :D
     
  29. Offline

    xTrollxDudex

    bennie3211 likes this.
  30. Offline

    DrMedia

    Not a half bad tutorial.
     
Thread Status:
Not open for further replies.

Share This Page