Starting Inventory (Minecraft)
Description
Sets the starting inventory of the player, including armor slots and offhand.
Warning
No more than a total of 41 items can be inserted into the inventory.
Tip
When testing the Starting Inventory items, use setTestStartingItems(true) to allow testing every time a player logs in instead of just the first.
Identifier
Refer to this via any of the following:
minecraft.player/* Used as page default */
minecraft.Player
Minecraft.player
Minecraft.Player
vanilla.player
vanilla.Player
Vanilla.player
Vanilla.Player
mods.mc.player
mods.mc.Player
mods.minecraft.player
mods.minecraft.PlayerEditing Values
Sets if the player inventory is cleared prior to giving the player these items:
groovyminecraft.player.setReplaceDefaultInventory(boolean)Sets if items given when joining the world regardless of if the flag has already been set:
groovyminecraft.player.setTestStartingItems(boolean)
Example
minecraft.player.setReplaceDefaultInventory(true)
minecraft.player.setTestStartingItems(true)Adding Entries
Adds the given itemstack to the inventory list:
groovyminecraft.player.addStartingItem(ItemStack)Adds the given itemstack to a specific slot in the inventory list in the format
itemstack,slot:groovyminecraft.player.addStartingItem(ItemStack, int)Removes all previously added inputs and sets the starting inventory in the format
isSlotSpecific,items:groovyminecraft.player.setStartingItems(boolean, ItemStack...)Removes all previously added inputs and sets the starting inventory in the format
isSlotSpecific,items:groovyminecraft.player.setStartingItems(boolean, List<ItemStack>)
Example
minecraft.player.addStartingItem(item('minecraft:clay_ball'))
minecraft.player.addStartingItem(item('minecraft:gold_ingot'))
minecraft.player.addStartingItem(item('minecraft:diamond'))
minecraft.player.addStartingItem(item('minecraft:nether_star'))
minecraft.player.addStartingItem(item('minecraft:water_bucket'))
minecraft.player.setStartingItems(true, item('minecraft:clay').withNbt([display:[Name:'Hotbar']]), null, null, null, null, null, null, null, null, item('minecraft:clay').withNbt([display:[Name:'Top row of inventory']]), null, null, null, null, null, null, null, null, item('minecraft:clay').withNbt([display:[Name:'Middle row of inventory']]), null, null, null, null, null, null, null, null, item('minecraft:clay').withNbt([display:[Name:'Bottom row of inventory']]), null, null, null, null, null, null, null, null, item('minecraft:diamond_boots'), item('minecraft:diamond_leggings'), item('minecraft:diamond_chestplate'), item('minecraft:diamond_helmet'), item('minecraft:clay').withNbt([display:[Name:'Offhand']]))