Solved Getting A firework effect on the player

Discussion in 'Plugin Development' started by MCForger, Jan 6, 2013.

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

    MCForger

    So I saw a post like this and followed what fireblast709 said and still can not get it to work!
    Here is the code and keeps saying can not spawn this entity over and over again when I move.
    Here is the event code:
    Code:
        @EventHandler(priority = EventPriority.MONITOR)   
        public void onPlayerMove(PlayerMoveEvent event)
        {
            Player p = event.getPlayer();
            if (!p.isOp())
            {
                return;
            }
            if (!TestCommand.testing.contains(p.getName()))
            {
                return;
            }
            Location loc = p.getLocation();
            Firework firework = p.getWorld().spawn(loc, Firework.class);
            FireworkMeta data = (FireworkMeta) firework.getFireworkMeta();
            data.addEffects(FireworkEffect.builder().withColor(Color.GREEN).with(Type.BALL_LARGE).build());
            data.setPower(2);
            firework.setFireworkMeta(data);
            return;
        }
    If it is a simple mistake I am going to face palm since I have been tired from making a custom ban plugin all night.
    Thank you for any help!
     
  2. Offline

    fireblast709

    Update your Craftbukkit
     
    Code0 likes this.
  3. Offline

    MCForger

    Alright thank you will try!

    fireblast709
    Thank you! This was the problem!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 8, 2016
Thread Status:
Not open for further replies.

Share This Page