Plugin category: FUN Suggested name: BossArena What I want: I began working on a plugin a few days ago called BossArena. It would teleport the player to a set arena, spawn a boss (either Ender Dragon, Wither (once it comes out), or Giant). They would have to kill the boss to win! See the code at https://github.com/pogostick29/BossArena and see if you can help implement any of the following features: √ Saving a player's location on join and sending them there on leave. (Thanks, Doggyroc!) -Stopping the boss from escaping the arena and griefing any blocks -Multiplayer. Players can fight alongside each other to defeat the boss! -Multiple arenas. -Classes (maybe customizable). (Doggyroc and I took care of this) Ideas for commands: I have the commands coded already. Ideas for permissions: I have the permissions coded already. When I'd like it by: Contribute whatever you can, whenever you can. If you'd like to Co-Author, let me know
Here is the code for the teleporting (Use it if you want.) Here, Put this in on the top of the class (Same) Code: HashMap<String, Location> l = new HashMap<String, Location>(); Then put this in the onCommand method where you teleport the player (Has to be above the player teleport method.) Code: Player p = (Player)sender; l.put(p.getName(), p.getLocation()); then put this when you finish the arena: Code: {DEFINE A PLAYER}.teleport(l.get({DEFINE A PLAYER}.getName())); l.put({DEFINE A PLAYER}.getName(), null); EDIT: Should probably reset when you go back (So that it uses less memory).
Thanks SO much! I tried saving the X, Y, and Z, then, on the back tp, using p.getLocation().setX() etc to do it, but it wasn't working. I'll give you credit once I release it. If you can help with anything else, it would be MUCH appreciated
Ill try to help with more, (The reason it wasn't working is cause you didn't give the world) but it is much easier and clean this way. Also, what do you mean by "MultiPlayer"? Also, Can you put the source on github? So that i can make commits to already existing code?
I'll put it up tomorrow. By multiplayer, I mean multiple people can fight together against the boss. I'll indicate that above. Noob thing, but I don't know how to post code on GitHub... I made an empty repo at https://github.com/pogostick29/BossArena EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Ok, so from what i see here i need to see the code to help, could i maybe help you maintain this plugin? Do you have windows? if so, They have a application for it http://windows.github.com/ EDIT: Looks like you figured it out EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Right now, BossArena is an idea with some code behind it. I'd love to Co-Author it with you! I'll try to get the code on github tomorrow, and we can add all the stuff I mentioned above. Check back tomorrow and I'll let you know when it's up
When teleporting a player back to the place they came from instead of using the code- Code: l.put({DEFINE A PLAYER}.getName(), null); Wouldn't it be more efficient to remove the 'player' from the hashmap eg Code: l.remove({DEFINE A PLAYER}.getName()); That way the reference to the players name will be removed and you wont have to deal with any null data if you ever need to use that hashmap for anything else. Also, don't forget to deal with the player onQuit, possibly send them back to their location before they quit then remove the reference to them.
I don't know how it would work but maybe you could try using something like WorldEdit to set the arena and setup so whichever mob is spawned in there can not leave the arena but can be killed. So maybe you could work it with a hashmap and listener and use the mob as the key?
I'll implement your idea. As far as OnQuit, when the player joins, they are added to the ArrayList infight. I can set it to remove them and tp them back OnQuit.
It would be awesome if it had health/damage/ability customization. Like, we could be able to make the giant similar to MineZ, with explosive jumps and such.
Have any of you heard of ? Skript -Stopping the boss from escaping the arena and griefing any blocks - Possible with WorldGuard. -Multiplayer. Players can fight alongside each other to defeat the boss! - Easy plugin system to make it so you teleport to the place, spawn a boss at random of 3 of wither, ender dragon or giant. Unless your looking for a reward system. -Multiple arenas. - You could set-up multiple arenas and make the plugin work so you can just enter another command like /setboss 2 etc. -Classes (maybe customizable). ClassSign Ehh have fun!
Yah sorry it was late, couldn't think :| Do you have the adding to arraylist above the tp? As far as i understand it will execute first, then once it is finished it will tp, the only place i can see it being a problem, is if it was multi-threaded. so Code: ArrayListCode Stuff Teleporting into arena code. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I'm going to do all of the coding myself. I think I'm going to make the admin select the arena with WorldEdit and then I can check if the player/boss griefs the arena or escapes. As far as multiplayer, I'm going to make the command syntax like this: /bossarena <boss> <class> so you pick the boss you want to fight and the class you want to be. Classes should be very easy, I'm going to do that now before anything else. Thanks! Code: if (args[0].equalsIgnoreCase("join")) { if (getConfig().getDouble("arenaspawnx") == 0.0 && getConfig().getDouble("arenaspawny") == 0.0 && getConfig().getDouble("arenaspawnz") == 0.0) { p.sendMessage(pre + ChatColor.RED + "Looks like an arena isn't set up yet!"); } else { p.getLocation().setX(getConfig().getDouble("arenaspawnx")); p.getLocation().setY(getConfig().getDouble("arenaspawny")); p.getLocation().setZ(getConfig().getDouble("arenaspawnz")); prevloc.put(p.getName(), p.getLocation()); infight.add(p.getName()); p.getWorld().spawnEntity(p.getLocation(), EntityType.ENDER_DRAGON); p.sendMessage(pre + ChatColor.GREEN + "Good Luck!"); } } Code: @EventHandler public void OnQuit (PlayerQuitEvent e) { Player p = e.getPlayer(); if (plugin.infight.contains(p.getName())) { p.teleport(plugin.prevloc.get(p.getName())); plugin.prevloc.remove(p.getName()); plugin.infight.remove(p.getName()); p.getWorld().getEntities().remove(EntityType.ENDER_DRAGON); } } EDIT by Moderator: merged posts, please use the edit button instead of double posting.