Originally Posted by
423 Million
Hello I have a problem that has been bothering me for sometime now and I actually managed to get around to fixing it just that every method i try seems to fail.
So the title states my problem and basically what happens in more detail is that when a player drink the flask completely, it is not crumbling as it will just spawn in an empty vial. I looked at the coding from ben which he did add in twice for the flask to be destroyed after 0 doses left.
1. Firstly, if you managed to fix it, fix it again.
2. Handle this in where-ever your inventory options are handled
3.
Code:
if (itemId == id) {
player.getInventory().remove(itemid, 1);
player.getInventory().addItem(vial, 1);
}