-
-
Notifications
You must be signed in to change notification settings - Fork 2
Place_On_Head
This data pack basically adds something similar to the /head command but for vanilla Minecraft. Using a trigger command you can swap/place the item/block that you are holding into the head slot. Theirs no useful functions for placing it on your head but some blocks look pretty cool. This is only possible in the 1.17 snapshot (20w46a) using the /item command.
- Works out-of-box
- Easy to use
- Custom item API
You can apply custom NBT tags to an item so it shows any text when a player places it on their head via the trigger command. Below you can find an example item "Space Helmet". There are multiple pre-set formats as well as full customizability to the text, even more than v1.0.0
v1.1.0+ will now require the head item to have its builder version. For example, if you made an item from v1.0.0 you will have to add the version 1.0.0, it should look something like this Version:"[1.0.0]" This will load the older builder meaning you will not need the Type as that was added in v1.1.0. You can also just define the latest and it will load the latest builder version. The code should look like this Version:"{latest-version}". If you put an invalid version it will tell you when you do /trigger head. If there is a part of the code that is missing that the builder needs it will most likely not display anything depending on what type you selected.
- Type:"renamed" This will automaticly make the text italic and add single quotes around the text, (Does not except RAW JSON/Formating) Swapped head item with 'Renamed Item Format'
give @p stone{head:{Version:"[1.1.0]",Type:"renamed",Name:"<Text to show up>"}}
- Type:"identifier" This will use a custom item id. Note that "id" is not located inside the "head" object. (I use this custom ID for all my current/new data packs that add "new" items, It makes things easier.) (Does not except RAW JSON/Formatting) Swapped head item with custom:custom_item_identifier
give @p stone{id:"custom:custom_item_identifier",head:{Version:"[1.1.0]"},Type:"identifier"}
- Type:"custom_name" This is similar to the old code from v1.0.0 but has the new Version and Type systems. (Excepts RAW JSON/Formatting) Swapped head item with Custom Name Text
give @p stone{head:{Version:[1.1.0],Type:"custom_name",Name:'{"text":"Custom Name Text","color":"aqua"}'}}
- Type:"custom_all" This is where you can completely customize the text that is displayed when you do /trigger head. (Excepts RAW JSON/Formatting) Begin: Custom Name Text
give @p stone{head:{Version:"[1.1.0]",Type:"custom_all",Name:'[{"text":"Begin: ","color":"dark_aqua"},{"text":"Custom Name text","color":"aqua"}]'}}
Get "Space Helmet" Item
give @p minecraft:tinted_glass{id:"custom:space_helmet",head:{Version:"{latest-version}",Type:"identifier"}},display:{Name:'{"text":"Space Helmet","italic":false}',Lore:['{"translate":"Use %s to place on head","color":"dark_gray","italic":false,"with":[{"text":"/trigger head","color":"gray","italic":true}]}']}}