Setting Areas For Cuboid

Discussion in 'Plugin Development' started by russ9929, Jun 25, 2012.

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

    russ9929

    I'm making a dungeon plugin and what I want to do is mark the dungeon off with 2 points set by an op. The main reason I want it set off is to limit only 4 people in the dungeon at once and I want to be able to turn off all commands while in the dungeon. Also when they finish the dungeon they will recieve a reward of diamonds once they walk onto the platform also market off by and op. I don't know how to make the cubicoid area like world edit does with a wand so I can do these things. Also I don't know how to stop all commands being used in that one area.
     
  2. you know how to listen for commands, then you only need to check if the player is inside the area
     
  3. Offline

    russ9929

    Right but how do I add the code so someone can set the 2 areas?
     
  4. Offline

    xxkomcxx

    I'm having the same problem. Do I hook it up with world edit or can I just use the wand and add it into the code? H
     
  5. search on the forums for "worldedit hooking selection"
     
  6. Offline

    hammale

    or you could write it yourself instead of messing around with world edit :) lemme know if u want some code
     
  7. Offline

    russ9929

    I need the code I did it with help and completly messed up trying to do it without worldedit




    Code:
        @EventHandler()
        public void onPlayerInteract(final PlayerInteractEvent event) {
            if (createSession.containsKey(event.getPlayer().getName())) {
                if (event.getPlayer().getItemInHand().getType() == Material.WOOD_SWORD) {
                    if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
                        event.getPlayer().sendMessage("Dungeon Start Set. Rick Click To Pick The End");
                        createSession.get(event.getPlayer().getName()).setStartBlock(event.getClickedBlock().getLocation());
                    } else if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                        createSession.get(event.getPlayer().getName()).setEndBlock(event.getClickedBlock().getLocation());
                        event.getPlayer().sendMessage("Dungeon End Set");
                    }
     
                }
            }
        }
     
Thread Status:
Not open for further replies.

Share This Page