Cancel onChunkLoad event

Discussion in 'Plugin Development' started by Draesia, Jun 17, 2013.

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

    Draesia

    How can I cancel the onChunkLoad event? (It doesn't implement Cancellable)
    I want to make it so the chunks in a specific area don't ever get loaded.
     
  2. Offline

    Wingzzz

    Loaded or generated? You don't want to cancel the loading of a chunk(which is why you can't). What you might be looking for is to make certain chunks generate full of air, is that a more accurate description of what you're attempting to do?
     
  3. Offline

    Burnett1

    You can get the chunk load event and then unload the chunk.

    Code:
        @EventHandler
        public void onLoad(ChunkLoadEvent e){
            if(e.isNewChunk()){
                e.getChunk().unload(true);
            }
        }
     
  4. Offline

    Draesia

    WiredWingzzz No, I do want to cancel the loading of a chunk.

    Burnett1 I was thinking this, however if a player was next to the chunk to be loaded, the chunk would load and unload very quickly many times, causing more lag than i'd like (I think, I will test now)
     
Thread Status:
Not open for further replies.

Share This Page