Jump to content

Making my entity drop an item every 10 minutes?


Recommended Posts

You can override onUpdate in your entity class. It's called once per tick while your entity exists so just count the ticks that way. When the counter reaches enough ticks spawn an item at his position.


Edit: I will demonstrate when I get home if someone else has not already helped. I'm on my phone atm though.

Link to comment
Share on other sites

int timer;
    int delay = 10 * (20 * 60); //10 mins

    public void onUpdate() {
        if(!worldObj.isRemote && timer++ >= delay){
            this.entityDropItem(new ItemStack(Items.slime_ball), 0);

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.