With the Minecraft setblock command (in game): we can do this:
/setblock -4 4 -132 minecraft:player_head[rotation=0]{SkullOwner:{Name:"playerName"}}
. That will place a player head of the specified player with the specified rotation.
How can I accomplish this in my mod.
I know that I can set a block to be a player head using setBlockState and having
setBlockState( BlockPos, Blocks.PLAYER_HEAD.getBlock().getDefaultState()
I also know that we can add a rotation to it by adding
.with(BlockStateProperties.ROTATION_0_15, 3)
But I am lost on how I would go about setting the nbt data for skull owner SkullOwner. If anyone could point me in the right direction that would be great.
Thanks,