Sorry there are a few things you have assumed that the reader will know.
First of all what API are you using? Api 8 (MC 1.16) or API 7 (1.12) - based on your usage of Text
im going to assume API 7 but clarification would be useful
Next is what are the types of your variables?
Player user;
Player player;
Inventory build;
for(Inventory slot : user.getInventory().slots()){
if (slot.peek().isPresent()) {
build.offer(slot.peek().get());
}
}
player.openInventory(build.parent(), Text.of(TextColors.DARK_RED, targetName + "'s " + "inventory"));
Like that? Or is user
a type of User
?
Next. Is this code ran as a command or as event? If event then what event?
And finally… When you say Drop normally
could you please clarify. Is it?
When the armor is equiped in the selected slot and then the player presses Q to drop the item this is “Normal”
Or
When the inventory is open and the player drags the armor outside the inventory window to drop the item this is “Normal”
Also the same goes for what is causing you bug. Is it when the inventory is open and the item is equipped to the player (say helmet on the helmet slot) and then attempts to drop the item, is this what causes the bug? And if you have it in that slot, but move it to another slot and then drop it, does it not cause the bug?
Sadly, if you want help, you need to specify as much useful data as possible
But in all seriousness. In Sponge, there is no special rules for specific items when dropping. That is unless a event gets in the way.
I would first check your testing environment. I would recommend Sponge Vanilla with only your plugin to ensure another plugin, mod or Forge is not interfering
If it still happens, i would then take a look at your own events, in particular any events that covers either dropping items or changing slots and ensure it doesnt delete the item (please note in sponge, cancelling events may not reset the inventory to its state before the trigger, therefore cancelling the drop item event will cancel the item being dropped, but the action still triggered and therefore the item is gone from the inventory)