WorldInitEvent and WorldLoadEvent don't work

Discussion in 'Plugin Development' started by ocomobock, Jun 9, 2015.

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

    ocomobock

    I'm trying to add a BlockPopulator and I'm trying to use WorldInitEvent to do it. This is what I have:

    @EventHandler
    public void onWorldInit(WorldInitEvent e)
    {
    getLogger().info("WorldInitEvent called");
    }

    @EventHandler
    public void onWorldLoad(WorldLoadEvent e)
    {
    getLogger().info("WorldLoadEvent called");
    }

    But neither of them are working. If it worked, I would be using this code (but even the test isn't producing any response):

    public void makeChest(WorldInitEvent e)
    {
    World w = e.getWorld();
    w.getPopulators().add(new ChestPopulate());
    getServer().broadcastMessage("IT WORKED");
    }



    This is really bothering me, cause I'm just trying to have chests generate throughout the world and I can't even get the events to do anything. And yes, I've registered the events. Does anyone know what I'm doing wrong?

    EDIT: I had to put 'load: STARTUP' in plugin.yml. Now I've just gotta see if the block populator will work.
     
    Last edited: Jun 9, 2015
  2. Offline

    teej107

    Are there any errors? From the code you posted, I don't see why it won't work. Please post more code and put them in the code tags please.
     
Thread Status:
Not open for further replies.

Share This Page