I’m having problems creating new EntityItems. I’ve tried using the following code (where player is the player)
Item item = (Item) player.getWorld().createEntity(EntityTypes.DROPPED_ITEM, player.getLocation().getPosition()).get();
item.offer(item.getItemData().item().set(itemStack));
item.getItemData
just calls get
on an absent Optional
How do I fix this?