It seems that caterpillars are only added to the inventory on the client-side, so the server doesn't know about the items. This means that the items aren't really in the client inventory. They cannot be placed, and will disappear when clicked on.
handleDamageEvent() is only called on clients in response to a message from the server, so this is the wrong place to add an item to the player's inventory.
It seems that caterpillars are only added to the inventory on the client-side, so the server doesn't know about the items. This means that the items aren't really in the client inventory. They cannot be placed, and will disappear when clicked on.