I want to summon a vanilla-minecraft wolf with an owner set already. I have stored the player's UUID in an nbt tag (on an itemstack), but when I use the setOwnerID() method, the dog wont get a collar, nor can I sit it down. But what is interesting is that it still walks towards me, and telepors if I go away... I tried using updateEntity() method (both on ServerWorld and ClientWorld). If I reopen my world, the dog has a collar, and I can make it sit. I'm kinda new, so this might be terribly obvious.
Thanks in advance!
My code for summoning the entity:
Minecraft instance= Minecraft.getInstance();
ServerWorld sWorld=Minecraft.getInstance().getIntegratedServer().getWorld(instance.player.getEntityWorld().getDimension().getType());
WolfEntity Entity=EntityType.WOLF.create(sWorld);
entity.moveToBlockPosAndAngles(instance.player.getPosition(),0,0);
entity.onInitialSpawn(sWorld, sWorld.getDifficultyForLocation(instance.player.getPosition()), SpawnReason.EVENT, eData, (CompoundNBT)null);
entity.setOwnerId(itemStackWithNBT.getStack().getTag().getUniqueId("owner"));
sWorld.addEntity(entity);
sWorld.updateEntity(entity);
instance.world.updateEntity(entity);
//Sorry for messy code
I also tried debugging using the isOwner() method, it said false.