Make ender dragon eggs NOT teleport on right click?

Discussion in 'Plugin Development' started by Bust_Open, Sep 2, 2012.

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

    Bust_Open

    How can I do this, I really need help with this for a future plugin of mine.

    Also how can I make this not release thr projectiles while being placed only while being right clicked on when it's placed?

    Code:
    Player p = event.getPlayer();
    event.getAction().equals(Action.RIGHT_CLICK_BLOCK.equals(Material.DRAGON_EGG));
    p.launchProjectile(Fireball.class);
    p.launchProjectile(Snowball.class);;
    p.launchProjectile(Arrow.class);
    p.sendMessage(ChatColor.DARK_GRAY+"You've released the wrath of the ender dragon!");
    
     
  2. Offline

    travja

    Couldn't you just cancel the interact event, what exactly are you trying to do...
     
  3. Offline

    Deleted user

    This.

    Just on PlayerInteractEvent

    if action == RIGHT_CLICK_BLOCK

    get the block type, if it's Material.DRAGON_EGG

    event.setCancelled(true);

    done.
     
  4. Offline

    Bust_Open

    Ugh, Ireally need help!
     
  5. Offline

    ZeusAllMighty11

    Guess you can't read?
     
    AaronL98 likes this.
  6. Offline

    Bust_Open

    thanks so far I have this

    Code:
    @EventHandler
    public void CannonInteract(PlayerInteractEvent event){
        Player p = event.getPlayer();
        if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
       event.getMaterial().equals(Material.DRAGON_EGG);
       event.setCancelled(true);
        }
    event.getAction().equals(Action.RIGHT_CLICK_BLOCK.equals(Material.DRAGON_EGG));
    p.launchProjectile(Fireball.class);
    p.launchProjectile(Snowball.class);;
    p.launchProjectile(Arrow.class);
    p.sendMessage(ChatColor.DARK_GRAY+"You've released the wrath of the ender dragon!");
    }
    }
    
    how can I make this not release thr projectiles while being placed only while being right clicked on when it's placed?

    ugh any help?

    uhhhhhh

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  7. Offline

    travja

    You need to put all the explosion stuff in the place where you cancel the event, otherwise it will go off whenever the interact event is called.
     
  8. Offline

    mmiillkkaa

    Code:
    @EventHandler
    public void CannonInteract(PlayerInteractEvent event){
        Player p = event.getPlayer();
        if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && event.getMaterial().equals(Material.DRAGON_EGG)) {
            event.setCancelled(true);
            p.launchProjectile(Fireball.class);
            p.launchProjectile(Snowball.class);;
            p.launchProjectile(Arrow.class);
            p.sendMessage(ChatColor.DARK_GRAY+"You've released the wrath of the ender dragon!");
        }
    }
    That should fix any problem.
     
  9. Offline

    Bust_Open

    Nope it's firing up while being placed and then disappears?
     
  10. you need to cancel the event if you want to block the teleport, if you dont know what I mean, search on google for "bukkit event setcancelled"
     
  11. Offline

    Bust_Open

    ugh can you do it for me? :confused:
     
  12. sorry, but I am more the kind of people that point in the right direction than giving easy code examples, if you create the codes by yourself, you learn more from it, like I never asked for help when I started delevoping bukkit
     
    ZeusAllMighty11 likes this.
  13. Offline

    Bust_Open

    helpppppppppppppp
     
  14. Offline

    ZeusAllMighty11

    Maybe if you stop spamming your topic like a little kid wiht 'helppppp' 'uhhhhh' 'aghhh'...
     
  15. Offline

    daboross

    I belive you have all the information you need here in this thread already...?
    Also have you checked out THIS?

    Please Read what people have already said instead of bumping your thread with pointless messages. If you need more help show what you have done with the information everyone has already given you!
     
    ferrybig likes this.
Thread Status:
Not open for further replies.

Share This Page