Ok, so now let's build a player. Here's the JSON I will use:
When building players, the JSON provided always needs at least two levels up - the Player's
class, and that class's class, if necessary (notice the parent
block.) Also, you'll notice from the previous page that the buildPermissiveness
array did not allow tokenHolder
permissions, so instead I had to rely on the fact that I had updateAuthority
on the NFT to build the Player
.
Also notice that I did something new here too with the NFTs. While the parent PlayerClass
NFT was located on mint GwB8Zt index 2, and the child was at edo3Dz index 4, I didn't use a whole new NFT for the Player
itself. I reused the second NFT, edo3Dz, just at a different index - 5! This is a very powerful design pattern you can use to create Singletons, if you wish.
Also notice that you get your choice of totalSpaceBytes
. Make sure to set it large enough to accommodate the maximum amount of equipment that can be attached to this Player
(the math is roughly 34 bytes multiplied by the number of BodyParts
multiplied by how many items per part can be applied). At some point in the future we will add dynamic account resizing to item equipping so that the account can grow and shrink as needed.
Here's the command to run to create the Player
:
After running, you can run the show_player
command to check out the state on chain:
Or from the client side:
You'll get something like this:
Note that on mainnet-beta, you'll be charged 1 $RAIN to build a player, and you'll receive that $RAIN back if you drain the player later.