Plugin Help Hub Events

Discussion in 'Plugin Help/Development/Requests' started by Ck1000MC, Feb 2, 2015.

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

    Ck1000MC

    Hey guys, I'm here with a brand new request again again again. This is a hard one and I don't expect anyone to make it. Anyway, here's some info.

    ===THE BASICS===

    This is a great donor perk example plugin. Players will have tons of fun every time a party lets out using a command!

    ===COMMANDS and PERMISSIONS===

    /he start [Event Name] – he.start.[event] – start a specific event

    /he end [Event Name] – he.end.[event] – end an event early

    ===EVENTS===

    > Party

    Be teleported upwards 5 blocks and have a 3x3 rainbow-wool platform below you to stand on. The center block of it is glass. Gold ingots, nuggets, and gold tools are shot out of you (enough power to be launched off of you below the platform). The rainbow wool platform changes wool colors every 0.5 seconds. The glass changes colors, too. Pigs and cows are launched from you in all directions, flying for a max distance of 10 blocks. When you shift, the world time changes from day to night. All of these effects end after 30 seconds. Cooldown time of 30 minutes.

    > Apocalypse

    Turn the time to night and summon Zombies, Spiders, Creepers, and Skeletons that attack players. Players do not get damaged, but take huge knockback when they are hit. Effects end after 20 seconds. Cooldown time of 15 minutes.

    ===IF ABLE===

    If you are able to, use MENUS!

    Instead of starting events with commands, you can open a GUI menu item (see below) when you right click. You can click a rotten flesh to activate APOCALYPSE, and you can click a GOLD NUGGET to activate PARTY.

    The GUI item is given to players who enter/respawn in the selected world. The actual item is a REDSTONE DUST. The GUI item can be configured in the config file.

    Set the world players get the GUI item when they enter the world or respawn in the world with:

    /he setworld [world] – he.setworld – sets the world players get the GUI item on entering/respawning

    ===OTHER NOTES===

    > Only 1 event can be active at once

    > Events cannot be started for 3 minutes after an event is ended
     
  2. Offline

    EpicCraft21

    Is it ok if the gold stuff just rain down from the sky, without those rainbow stuff?
    And I don't think it is possible to make the players take no damage from the mobs. I'll try.
     
  3. Offline

    Ck1000MC

  4. Offline

    EpicCraft21

    You just gave me a big idea for a plugin that's like this but with even more stuff :D you get 50% credit.
     
  5. Offline

    Ck1000MC

    @EpicCraft21
    Ok, but will I get this actual plugin the way I want it at all or are you gonna make your own...?
     
  6. Offline

    XgXXSnipz

    @EpicCraft21 Its more than possible to allow players to not take damage from mobs :D
     
  7. Offline

    Ck1000MC

  8. Offline

    XgXXSnipz

    @Ck1000MC @EpicCraft21 Create a damage handler, check if its a player getting damaged.. check if he gets damaged by a certain mob.. if he does.. then cancel the event
     
  9. Offline

    Ck1000MC

  10. Offline

    EpicCraft21

    Both.
    Both.
     
  11. Offline

    Ck1000MC

    @EpicCraft21
    Ok... And by the way, I can add tons more features like this, like particles, gadgets/tools, morphs/mutations, all that stuff. And when do you think the plugin will be done?
     
  12. Offline

    EpicCraft21

    A week, as long as I get to use the computer.
     
  13. Offline

    quakemaster1209

    wow that is a big no.

    if you want it to be unplayable for your players. having the blocks change at that rate causes severe lag both client and server side REGARDLESS OF RAM.
     
  14. Offline

    Ck1000MC

  15. Offline

    quakemaster1209

    That is HDD/SSD Storage which is different from RAM. the amount of HDD/SSD Storage wont affect game speed. Nonetheless having blocks change at that rate eats up the RAM and CPU on both Server side and Client side.
    HDD/SSD Space doesn't really affect performance.
    By calling block changes at that rate you would drastically reduce the TPS on on the server and the FPS for anyone near it REGARDLESS of their Computer's GPU and CPU.
     
  16. Offline

    Ck1000MC

    @quakemaster1209
    Space does effect performance, if you don't have enough storage for plugins and worlds and whatnot, everyone on the server will lag insanely hard, and basically everything will have to be reset (this happened to me 4 times).

    @EpicCraft21
    How's the plugin coming along?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  17. Offline

    Ck1000MC

    @EpicCraft21
    Are you almsost done with the plugin?

    Yeah

    @EpicCraft21
    How many more hours/days until you can give it to meh :D
     
    Last edited by a moderator: Feb 9, 2015
  18. Offline

    EpicCraft21

    Ugh this is harder than I thought... maybe tomorrow at minimum?

    EDIT: Never,ind, this is way harder than i thought. My stupid code should be working, but it leaves a bunch of errors. Someone else do this(again). When is the last time I finished a project???
    Code:
    package me.epiccraft21;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.World;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.entity.EntityDamageByEntityEvent;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.scheduler.BukkitRunnable;
    
    public class commands implements CommandExecutor {
       
        private List<Player> cd = new ArrayList<Player>();
        CountDown d = new CountDown();
       
        private final main plugin;
       
        public commands(main plugin){
            this.plugin = plugin;
        }
       
    
        public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
            Player p = (Player) sender;
            World world = p.getWorld();
            Location loc = p.getLocation();
            int event = 0;
            if(args.length == 0){
                p.sendMessage(ChatColor.MAGIC + "Commands: /he  <start, end> <party, apocalypse>");
            }else if(args.length == 1){
                   
                if(args[0].equalsIgnoreCase("start")){
                    p.sendMessage("Commands: /he  <start, end> <party, apocalypse>");
                    if(args.length == 2){
                        if(args[1].equalsIgnoreCase("party") && event == 0){
                            if(!cd.contains(p)){
                            cd.add(p);
                            d.setList(cd);
                            d.setPlayer(p);
                            new Thread(d).start();
                            event = 1;
                            Bukkit.broadcastMessage(ChatColor.GOLD + "A party has started!");
                            if(p.isSneaking()){
                                world.setTime(world.getTime() + 100);
                            }
                            }
                        }else{
                            p.sendMessage("Sorry, this event is either on cooldown or another event is active!");
                        }
                        if(args[1].equalsIgnoreCase("apocalypse") && event == 0){
                            if(!cd.contains(p)){
                                cd.add(p);
                                d.setList(cd);
                                d.setPlayer(p);
                                new Thread(d).start();
                            event = 2;
                            world.setTime(18000);
                            Bukkit.broadcastMessage(ChatColor.DARK_GREEN + "The apocalypse has come...");
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.ZOMBIE);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SKELETON);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.SPIDER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                            world.spawnEntity(loc, EntityType.CREEPER);
                           
                           
                            }
                        }
                   
                    }
                }
            }
           
            return false;
        }
       
        public void countdown(final Player p, final int i){
            new BukkitRunnable(){
                int countdown = i;
                public void run() {
                    if(countdown <= 1){
                        this.cancel();return;
                    }else{
                        countdown--;
                        Bukkit.broadcastMessage(ChatColor.GOLD + "Party ends in " + countdown + "seconds!");
                       
                    }
                }
                long zero = 0;
            }.runTaskTimer(plugin, 0, 500);
        }
       
       
        public class CountDown implements Runnable{
           
            public Player p = null;
            public List<Player> cd = new ArrayList<Player>();
            public void setPlayer(Player p){
                this.p = p;
            }
           
            public void setList(List<Player> list){
                this.cd = list;
            }
            public List<Player> getList(){
                return cd;
            }
    
            public void run(){
                try{
                    Thread.sleep(36000);
                    cd.remove(p);
                }catch(Exception ignored){
                   
                }
                   
               
            }
        }
       
        @EventHandler
        public void onEntityDamage(EntityDamageByEntityEvent e){
            if(!(e.getDamager() instanceof Player)){
                e.setCancelled(true);
            }
               
           
        }
    }
    
     
    Last edited: Feb 9, 2015
  19. Offline

    Ck1000MC

    @EpicCraft21
    Dude, every single project you say your going to do you just quit -_-
     
  20. Offline

    EpicCraft21

    Yeah ik I was going to apologize bu as I said my computer is messed up big time. Won't be doing requests for a long time.
     
  21. Offline

    Ck1000MC

    @EpicCraft21
    Alright, if your computer ever gets fixed, contact me please :D
     
Thread Status:
Not open for further replies.

Share This Page