Jump to content

Recommended Posts

Posted (edited)
7 hours ago, valzahd said:

ive been trying every possible way for like the past hour, ive used the wiki and i cant figure it out, especially the attributes

What appears to be the problem? What are you trying to obtain via command? If it is causing too much trouble, you might find it easier going into creative mode (/gm 2) and getting the item of your choice via the creative menu before switching back into survival mode (/gm 1).

Edited by Brady_The
Posted (edited)

Well, it's not as cryptic as one might think, but it does require knowledge of how and where to find the block/item names, optionally their attributes (most things don't have any).

 

First thing would be to turn on Developer Mode in your options, and then enable Extended Debug Info on the Dev tab.

To find an item/blocks identification code (which is what we need for the /giveitem command), the easiest way is to hold the mouse over the item/block, and look at the tooltip. The first line is the human readable name, then we have the ID: number and CODE: , optionally there might be a description of the the item/block on the bottom of the tooltip. The part we're interested in, would be what's shown after CODE: , example-> game:leather-normal-blue

 

You'll notice the string after CODE: will start with game:  .This is what we call a domain prefix. Everything from vanilla game, will have the game domain prefixed the item/block string. Items or blocks added by mods, will have their domain name prefixed in stead of the game: prefix.

 

Pressing SHIFT while holding the mouse over the item/block, will also show what attributes may be associated with the item/block.

 

Now, if we wanted to give a player named Gandalf, the mentioned blue leather shown in the example above, this would be the command:

/giveitem leather-normal-blue 10 Gandalf

This would give 10 blue leathers to the player named Gandalf.

Note: Playernames must be exactly as they appear in game, case and all. To give yourself the item/block, you don't need to add the name, as it will default giving to the one using the command.

 

Now lets give an item with attributes to the same player. We choose a shield, as those have many attributes for each variety.

/giveitem shield-metal{"wood": "generic", "metal": "iron", "color": "pink", "deco": "ornate"} 1 Gandalf

This will give the player Gandalf a Pink Ornate Iron Shield

 

If we wanted to give all the online players of a server, the same shield, we would use this command:

/giveitem shield-metal{"wood": "generic", "metal": "iron", "color": "pink", "deco": "ornate"} 1 p[]

The two characters after the p, are the square brackets [ and ]

 

 

Hope this helps 🙂

Edited by xXx_Ape_xXx
  • Like 1
  • Thanks 2
Posted
1 hour ago, wildforester said:

getting the item names is annoying though

Added note, to find the item or block names:

 

/bir list

/iir list

 

This will print out all the block and item id's and names in the "server-main.log" file.

  • Thanks 1
  • 4 months later...
Posted
On 8/13/2025 at 7:10 PM, xXx_Ape_xXx said:

Now, if we wanted to give a player named Gandalf, the mentioned blue leather shown in the example above, this would be the command:

/giveitem leather-normal-blue 10 Gandalf

This would give 10 blue leathers to the player named Gandalf.

Note: Playernames must be exactly as they appear in game, case and all. To give yourself the item/block, you don't need to add the name, as it will default giving to the one using the command.

 

Now lets give an item with attributes to the same player. We choose a shield, as those have many attributes for each variety.

/giveitem shield-metal{"wood": "generic", "metal": "iron", "color": "pink", "deco": "ornate"} 1 Gandalf

This will give the player Gandalf a Pink Ornate Iron Shield

 

If we wanted to give all the online players of a server, the same shield, we would use this command:

/giveitem shield-metal{"wood": "generic", "metal": "iron", "color": "pink", "deco": "ornate"} 1 p[]

The two characters after the p, are the square brackets [ and ]

Thanks for the help on this, definitely a good explanation for beginners trying to figure out hosting and modding, which I am. One thing though, the above commands work with certain items and materials, but I couldn't get it to give me any blocks or specifically beds.  Tried for an hour or so guessing different attributes it may have, but never got it working. A friend and I were trying to test if the bed spawn mod worked on his server which he's hosting on a kubernetes cluster, but we couldn't figure out how to spawn one in to test. We just decided to run the server with the mods and make one from scratch, which doesn't take long, but this still begs the question how to spawn in blocks and other items with /giveitem dev commands. Hopefully you see this and solve my mystery. Thanks again!

Posted (edited)
43 minutes ago, Stackmo said:

but this still begs the question how to spawn in blocks and other items with /giveitem dev commands

What's most likely missing in your case is the correct command. "/giveitem" is for items. Blocks require the command "/giveblock". The next hurdle would be the correct asset code.

The easiest way to obtain those would be via Creative Inventory. However, if you don't have any admin powers, the next best way would be to execute the command ".edi" in chat. This adds among other things, the page code of assets to their handbook pages.
This gives you two information.

  1. Is it a block or an item.
  2. What is the asset code.

With those you can now spawn the aged wooden bed (or any other asset). /giveblock bed-woodaged-head-north, followed by the quantity if you need more than one and the target, if you are not giving the bed to yourself. "/help" giveblock" in the ingame chat will help you with any optional parameters.

image.png.f57dc883aa10be44bc7f6106e5e5d3f4.png

Edited by Brady_The
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.