Posted July 30, 20205 yr 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,
July 30, 20205 yr The only two ways I can think of is either use SkullTileEntity.setPlayerProfile() or call onBlockPlacedBy() and pass in a stack with the nbt data you want. Both of them basically do the same thing.
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.