Wheat Growing

Discussion in 'Plugin Development' started by hvergi, Jul 16, 2011.

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

    hvergi

    I am developing a custom plugin for a friends server which limits the growth of wheat to 1 stage per a minecraft day. As far as I can tell there isn't an event for when crops grow, or when the state of a block changes. If there is please do tell. Is there currently a way to do this as a plugin and not as a custom bukkit build? I don't need the plugin made for me, but some pointers in the right direction would help.

    Thank you for your time.
     
  2. Offline

    cholo71796

    I'm pretty sure that stage of wheat growth is started in the MaterialData. Retrieve it with someblockvariable.getData(), set it with someblockvariable.setData(). For wheat, I believe data values go from 0 through 7.
     
  3. Offline

    hvergi

    Yup that it is, I can add and remove from the crop blocks fine but I want to stop the natural growth of them and use mine instead.
     
  4. Offline

    cholo71796

    Oh, I see. Well, there isn't any CropGrowEvent, so I don't think it's really possible to cancel
     
  5. Offline

    EdTheLoon

    I don't think the wheat's MaterialData triggers any events when it changes data which is unfortunate :/ Would be great if there was an event for MaterialData being changed as I need it for one of my plugins in development as well :(
     
  6. Offline

    Haias

    Well, if you find no decent events that fire when a block's data changes, I'd keep a constant loop going, checking every 20 ticks to revert the wheat back to its desired state.

    And you'd have to hook up all wheat blocks by watching every player's right click event.
     
Thread Status:
Not open for further replies.

Share This Page