int [] ITEM_IDS, dunno why you use [] as it's one ID, getItemIds() is also redundant as item itself is defined by handled inside xml. Delete both.
Gender change in one line
player.getAppearance().setSex(player.getAppearance().getSex() == Sex.MALE ? Sex.FEMALE : Sex.MALE);
Logout if you want
ThreadPool.schedule(() -> player.logout(false), 3000);
The last else if, make it if like (you can add msg about wrong quantity)
if (!player.destroyItemByItemId("rdestroy", id, count, null, true))
return;
Rest of the code, move out of else.