Solved AutoPlant

Discussion in 'Plugin Development' started by Smeary_Subset, Aug 25, 2022.

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

    Smeary_Subset

    I want to create a plugin where when a player right clicks a fully grown plant with a hoe, it harvests the plant and then replants the same type of plant if the player has the necessary material to do so (whether it be seeds, potatoes, etc).

    Is there a way to auto plant seeds through the API?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Smeary_Subset Can just set the block type to the same type as before after breaking it.
     
  3. Offline

    Smeary_Subset

    Ok. I also want to make it so the harvested crops don't drop but instead go straight into the player's inventory. How can I do that given that crops like potatoes and carrots may drop more than one? Of course, one way to do this is look up the chances of potatoes/carrots dropping x number of themselves when harvested and replicating that formula in my code, but didn't know if there was a simpler way using the API.

    For example, perhaps break the block naturally, find how many items were dropped, put those items in the player's inventory and then cancel the block break?

    Any other ideas?
     
  4. Offline

    Smeary_Subset

    Solved. Basically just did the second idea I recommended above
     
  5. Offline

    Kars

  6. Offline

    Smeary_Subset

    Thanks! However I am adamant on making all my own plugins in house. I want to know exactly what's going on with my server's plugins and be able to add features that fit my needs. I do appreciate the reccommendation though.
     
Thread Status:
Not open for further replies.

Share This Page