Solved Check if new chunk was generated

Discussion in 'Plugin Development' started by mr_nice1107, Nov 27, 2019.

  1. Offline

    mr_nice1107

    Hey there,

    I have a question!?

    Is there a way to check if a new chunk was generated?
    So to explain my project, I want to make a custom world that resets every 2 days

    Then I want to check if a new chunk was generated in this world and want to put lootchests on it

    So is there a possibility to cal a method or class everytime when a new chunk was generated the first time so I can then create a new chest there

    An another question:
    Is there a way to get the coordinats of the surface of a location? So that the chests will only spawn on top of the map and not in the air or under the ground!?


    Thank you for your awnsers !
     
  2. Offline

    CraftCreeper6

    @mr_nice1107
    ChunkLoadEvent

    For the second question, you can iterate from y 0 upwards until you find ~15 consecutive air blocks to get the surface block.
     
  3. Offline

    mr_nice1107

    ok thank you
     

Share This Page