Posted March 5, 20223 yr I'm trying to overcome a little issue. I'm trying to save data to an item's tag. This works perfectly fine in survival but does not work in creative mode. @Override public ActionResultType interactLivingEntity(ItemStack stack, PlayerEntity player, LivingEntity livingEntity, Hand hand) { if (hasAnimal(stack) || !livingEntity.isAlive() || livingEntity instanceof PlayerEntity) return ActionResultType.PASS; if (!player.level.isClientSide && livingEntity.isAlive() && livingEntity instanceof MonsterEntity) { CompoundNBT entityNBT = livingEntity.serializeNBT(); stack.getOrCreateTag().put(NBT_ANIMAL,entityNBT); livingEntity.remove(); return ActionResultType.SUCCESS; } return ActionResultType.PASS; } I totally get if I was trying to do something like ItemStack.HurtAndBreak() which would damage it, but the tags don't even populate with data once outside of this event (They are retrievable while still locally in the event and have access to the instance passed into the event). The item in question is a single-stack item. Switching to Survival rectifies this situation. Is this expected? Normal? If not am I doing something wrong? ~BrewingCoder
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.