i want to calling event in event

Discussion in 'Plugin Development' started by nongman1, Dec 28, 2014.

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

    nongman1

    @EventHandler

    public void onInteract(PlayerInteractEvent e)
    {
    }


    @EventHandler

    public void onPlayerClick(InventoryClickEvent e1){ //click

    Player player = (Player)e1.getWhoClicked();

    if(e1.getCurrentItem().getType().equals(Material.GLASS_BOTTLE))

    {

    InteractEvent(PlayerInteractEvent /* i have to writte constructor here?*/;
    {
    //codes
    }

    }
    }

    if my class name is nongman im writte there a nongman??
    im learn that construtor 's name is class name
     
  2. Offline

    mine-care

    1. use code tags, makes thins easyer to read.
    2. what constructor!? your code is a bit unclear
    what is this^

    Please explain a bit more what you try to do.
     
  3. PlayerInteractEvent event = new PlayerInteractEvent(some_args_probably_go_here);
    Bukkit.getPluginManager().callEvent(event); //This line may be wrong, it's something similar to this though
     
  4. Offline

    1Rogue

    Never do this.
     
  5. Why not? I use this in a plugin I have currently so what's the downside to it?
     
  6. Offline

    1Rogue

    You shouldn't be using internal events like that, especially since you cannot know the ramifications of doing so with other plugins.
     
    WD_MUFFINFLUFFER likes this.
Thread Status:
Not open for further replies.

Share This Page