Jump to content

Making my entity drop an item every 10 minutes?


KingYoshiYT

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

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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