Minecraft Data Packs / Game Mechanic

More NBT Tags [Datapack Edition]

  • check_circle Functions
  • check_circle Loot Tables
  • check_circle Structures
  • 5,376 views, 4 today
  • 155 downloads, 1 today
  • 23
  • 13
  • 16
legopitstop avatar legopitstop
Level 74 : Legendary Programmer
233

More NBT tags [​Datapack Edition]

by Legopitstop

More NBT Tags [Datapack Edition] Minecraft Data Pack More NBT Tags [Datapack Edition] Minecraft Data Pack More NBT Tags [Datapack Edition] Minecraft Data Pack

This data pack adds some custom NBT (Named Binary Tags) to items. Right now this is in its early stages but I think there still is a lot of action-packed NBT to make your items customizable with little code. Below you can find a spoiler on the format of the pack. make sure you spell everything correctly and is in the correct format. If you have any issues consider commenting below or via my discord server or if you have any ideas to be added to this wonderful data pack. This does not add anything out-of-box, Its more of an API for other commands/datapacks. I highly recommend checking the Github WIKI to learn more about how to use this datapack.

Note: This Data pack only works in 1.17 snapshots, it contains the new `/item` command, and no, there is no way this can/will work on older version/non-snapshots.

tested on 1.17 snapshot 21w15a and up, Unless future snapshots change the /item command or the marker entity.

View Wiki Page

NBT Features

Items

- Run an event when the target...
  - Uses the item.
  - Uses the item on a block.
  - Holds the item.
  - Wears the item.
- Deal damage to the tool
- Create an animated model using multiple CustomModelData tags.
- Create a throwable item, like a snowball
- Apply custom durability to the item, and determine how to show it.
- Create a shooter item, like a bow.
- Create a custom item that can hold and store items.
- Make the item place a custom block.
- Create a user interface that includes buttons that can run events.
- Create a custom food item that runs an event when you consume it or what item it becomes.

Blocks (W.I.P)

- Run an event when the target...
  - breaks the block
  - Places the block
  - Clicks on the block
- Create a custom loot table for the block when you break it.
and much more to come!

Entities/Player (W.I.P)

- Run an event when the player...
  - the item is in a certain slot inside the player's inventory
  - is holding an item
  - walks on a block
  - is near an entity.
and much more to come!

What are events?

What is an event? Events are code that can do one or more of the following:
- Gives an effect
- Removes an effect
- Kill a target
- Transform an item
- Merge data
- Show text like title, tellraw, subtitle, actionbar, say, etc.
- Remove an item from the stack
- Play a sound
- Add, set, or remove an amount from a score
- Deal damage to the target.
- Reload the server (has a setting to toggle this)
- Random number generator! (RNG)
- Summon an entity
- Spawn a structure.
and more to come!

And Much More!! For more information and code examples view the Github Wiki

Modified Legopitstop's License
View the normal license: https://legopitstop.weebly.com/legopitstops-common-license.html

Modified Version:

Do NOT:
⚠️ Do Not upload mod on any other website, If you want it added to your website please ask.
⚠️ Do Not claim ownership over this mod.
⚠️ Do Not profit from this mod.

Do:
✔️ Do promote this mod to others.
✔️ Do report bugs/issues with the mod.
✔️ Do credit Legopitstop.
✔️ Do use this mod in your world.
✔️ Do make awesome videos of this mod!
✔️ Do use this mod on your private server.

Other Things To Note:
+ You may not create your own download link to the "vanilla"/unedited version of the pack, Use the CurseForge link if you want players to install both datapacks (This data pack and yours). It is recommended to use this option.

+ You can include the current version of the pack inside your datapack, Inside your pack as in you take out the more_nbt file and place it inside yours, keeping in mind that it requires the #minecraft:tick and #minecraft:load files. You must keep the reload message inside and working.

If you have any questions or comments about this modification to the license you may contact Legopitstop.


Legopitstop's Common License



Buy Me a Coffee at ko-fi.com www.patreon.com
CreditLegopitstop
CompatibilityMinecraft 1.17
Tags

5 Update Logs

Update #5 : by legopitstop 04/19/2021 3:00:59 pmApr 19th, 2021

# **V1.5.0 Changelog**
## **General**
- `nbt_format` has been increased to 4
- Added custom pack icon.
- Changelogs will now be in [markdown](en.wikipedia.org/wiki/Markdown) format
- Settings is now called config `/function more_nbt:config`
- Config will now save the setting to storage `more_nbt:config` instead of scoreboard. See more below.
- Only works for Minecraft 1.17 Snapshot 21w15a+ (uses the new `minecraft:marker` entity)

***

## **NBT Changes**
- changed `replaceitem` event to `item`. which adds more features.
- wearable tag will now remove the item that you place on your head unless you are in creative. This only works for the head slot. If you have my datapack `place on head` installled it will use the trigger command intead.
- Added `this` target selector for die events.
- removed `gamemode` from `decrement_stack` by default `decrement_stack:{}` will not remove items when the player is in creative. `decrement_stack` optionally excepts `ignore_game_mode` when set to true it will remove the items from all players.
- `decrement_stack` will now remove one item, instead of removing all items.
examples;
### before
```jsonc
{"decrement_stack": {"gamemode": ["!creative"]}} // removes for non creative players
{"decrement_stack": {"gamemode": ["all"]}} // removes for all players.
```
### After
```jsonc
{"decrement_stack":{}} // removes for non creative players
{"decrement_stack":{"ignore_game_mode":true}} // removes for all players.
```

***

## **New NBT**
### `on_use` event trigger for items.
added optional `cooldown` timer to `on_use` event trigger. This will set the timer to the number that has been set, then count down. The event will not trigger unless the cooldown time is 0. `value` is in ticks (sec * 20 = ticks). May add more customizability to this tag in the future.
#### Example
```jsonc
{"on_use": {"cooldown": {"value": 60},"add_mob_effect": [{"effect": "minecraft:glowing","target": "this"}]}}
```
### `item` Item Event
Like the `/item` command, replaces `replaceitem`
#### example:
```jsonc
{"item":{"type":"entity","slot":"armor.head","copy":{"type":"entity","slot":"weapon.mainhand"}}}
```
### New Inventory save options
- added 2 more auto save storage options for `Inventory`.
- `enderChest` will save your items to your ender chest, Their is an issue where if you have your item ender chest open and you add items to your block ender chest it will remove the item. (not multiplayer tested)
- `cloud` will save your items to the world, works similar to ender chest but only works with the custom item, Like a global enderchest.
#### examples:
```jsonc
{"Inventory":{"show_items":"nbt","inventory_type":"chest","auto_save":{"storage":"enderChest"}}}
{"Inventory":{"show_items":"nbt","inventory_type":"chest","auto_save":{"storage":"cloud"}}}
```
### Simple Tags
- Simple tags. These tags go directly on the item.
- added `NoGravity` tag to items when the item is dropped it will not fall down. However it will still follow the direction that you threw it.
- added `NoMotion` tag to items. when the item is dropped it will not move.
- added `Invulnerable` tag to items. the item will not get killed, some funkyness when throwing this item in lava and/or fire, makes it invisable.
- added `foil` tag to items. When set to true it will apply the enchanted glint to the item.
#### Examples:
```jsonc
{"NoGravity": true,"NoMotion": true,"Invulnerable": true,"foil": true}
```
```mcfunction
give @p stick{NoGravity: true,NoMotion: true,Invulnerable: true,foil: true} 1
```
### `play_soud` Item Event
- added more sounds to `play_sound` Item Event
- minecraft:item.armor.equip_chain
- minecraft:item.armor.equip_diamond
- minecraft:item.armor.equip_elytra
- minecraft:item.armor.equip_generic
- minecraft:item.armor.equip_gold
- minecraft:item.armor.equip_iron
- minecraft:item.armor.equip_leather
- minecraft:item.armor.equip_netherite
- minecraft:item.armor.equip_turtle
- minecraft:event.raid.horn

- added new entity triggers. Runs via storage `minecraft:entity` See [Entity Triggers](#Entity%20Triggers) section

***
### Entity Tags (Experimental)
- [See Wiki for more.](github.com/legopitstop/More-NBT-Tags-Datapack/wiki)
- Supported conditions
- `entity_properties`
- `match_tool` - only supports tool, weapon items.
- `time_check`
- `weather_check`
#### example:
```jsonc
{
"triggers": [
{
"debug": true, // when true it will tell via actionbar if condition is true.
"type": "minecraft:conditions",
"conditions": [ // Recomended to use a predecicate generator. Note that their is only support for some conditions.
{
"condition": "minecraft:time_check",
"value": { // Takes in an object or just a constant value.
"min": 0,
"max": 6000
},
"events": {...}
},
{
"condition": "minecraft:weather_check",
"raining": true,
"thundering": false,
"events": {...}
}
]
}
]
}
```

***
### How to add triggers to entities in your datapack.
- create your datapack
- add the file `entity.json` to `data\minecraft\tags\functions\entity.json`. Then add, and replace the below code
```jsonc
{
"replace": false,
"values": [
"<namespace>:<file>" // replace <namespace> with your datapacks unique namespace and <file> with your unique file name, these shouldent matter, as long as the JSON name and location are as stated.
]
}
```
- Then inside the mcfunction file that your referanced in the .json is where you place the below command and modify it to your needs. Note that `<entityID>` only currently supports `player`.
```mcfunction
data modify storage minecraft:entity entity.<entityID> set value {"triggers":[{<trigger data>}]}
```
- Once you have edited it to your liking you can do /reload to apply your changes.

***
### Custom blocks `BlockTag` (Experimental)
- Note that everything here is subject to change in future versions.
- The `BlockTag` tag for items will create a block when you place it. Only works on `minecraft:armor_stand`
- See the wiki for more.
#### Examples
Tags on the item.
```jsonc
{
"BlockTag": {
"id": "custom:block", // The id of the custom block
"material": "minecraft:cobblestone", // The vanilla minecraft block to use. Keep note of all the vanilla behvaiors.
"loot": {
"ignore_gaemmode": true, // when true the loot will drop no matter what gaemmode the player is. default: false.
"type": "minecraft:loot", // types: `loot` will use the table. `this` will drop the custom item that you used to place the block.
"table": "<the loot-table to use>", // needed if type=loot.
},
"on_destory": {} // when the block has been broken.
}
}
```
Tags that are stored on the block. These are tags that are stored on the block.
```jsonc
{
"data": {
"id": "custom:block", // The id of the block
"property_options": { // All the block properties used.
"minecraft:facing": [
0, 1, 2, 3, 4, 5
]
},
"properties": { // The current property
"minecraft:facing": "<string>"
},
"loot": { // The loot to use when the block has been broken.
"conditions": {},
"ignore_gamemode": true,
"type": "minecraft:loot",
"table": "<the loot-table to use>"
}
}
}
```
***
### Config Data
- Config file is located storage more_nbt:config
- use `/function more_nbt:config` to open the config UI.
```jsonc
{
"version": 1, // The version of config.
"config": {
"debugLog": false, // When true it will give an output via the chat log. default: false
"on_use_reload": false // When true you can use the `reload` item component. default: false
}
}
```

## **DebugLog**
- Added support for the new entity triggers nbt.
- Activate the debugLog (both for items and entity) via the config `/function more_nbt:config`

## **Example Item**
- Added 'Pocket Ender Chest' example item.
- Fixed sea treasure loot item not working.
- Added 'custom block'
- Added 'foods' that contains 2 custom food items.

## **Documentation**
- Added all documentation to Github Wiki.
LOAD MORE LOGS

Create an account or sign in to comment.

1
08/14/2021 2:24 am
Level 27 : Expert Princess
BlockyGoddess
BlockyGoddess avatar
Hello you wonderful person!

Don't know if this mod will see further updates. Haven't used it yet but soon planning on doing so.

Anyway, one aspect I'm interested in is the animation.
I've been looking into using custommodeldata to be able to customise tools per individual layer. (like allowing layer 2 to be changed while keeping 1 and 3 as old.)
Do you think there could be a method to accomplish this?
1
01/17/2021 11:26 am
Level 1 : New Miner
Diamantesalateae
Diamantesalateae avatar
HELLO THERE

IM HERE FOR SOME INFO AND WARING IN YOU!

Please take out your snapshot code because they must copy your Code and make some progress to change your entire Data pack this comment is warning must do sceenshot your own game not the code Then, Bye <3
1
01/18/2021 12:37 pm
Level 74 : Legendary Programmer
legopitstop
legopitstop avatar
I don't' think you understand what this datapack does. This datapack adds in usable custom nbt tags in Minecraft for other people to use (like an API). This datapack is useless for normal people who don't use NBT. But is a good way to get into using NBT without having to create a lot of code. For example my Christmas Presents Datapack that requires this datapack API.
1
12/12/2020 6:42 pm
Level 1 : New Miner
Zai1208
Zai1208 avatar
1
12/12/2020 6:54 pmhistory
Level 1 : New Miner
Zai1208
Zai1208 avatar
More specifically
execute as @p[​x_rotation=45,y_rotation=90]
x_rotation is the rotation around the x axis
and y_rotation is the rotation around the y axis
2
12/13/2020 2:39 pm
Level 74 : Legendary Programmer
legopitstop
legopitstop avatar
thanks, will have a look
1
12/14/2020 4:34 pm
Level 1 : New Miner
Zai1208
Zai1208 avatar
Found a very good answer

preperation
scoreboard objectives add x dummy
scoreboard objectives add y dummy
scoreboard objectives add z dummy

When you want to activate it:
execute as @p at @s run summon snowball ^ ^ ^1 {Tags:["toMove"]}
execute as @e[type=snowball,tag=toMove] store result score @s x run data get entity @s Pos[0] 50
execute as @e[type=snowball,tag=toMove] store result score @s y run data get entity @s Pos[1] 50
execute as @e[type=tnt,tag=toMove] store result score @s z run data get entity @s Pos[2] 50
execute as @p store result score @s x run data get entity @s Pos[0] 50
execute as @p store result score @s y run data get entity @s Pos[1] 50
execute as @p store result score @s z run data get entity @s Pos[2] 50
scoreboard players operation @e[type=snowball,tag=toMove] x -= @p x
scoreboard players operation @e[type=snowball,tag=toMove] y -= @p y
scoreboard players operation @e[type=snowball,tag=toMove] z -= @p z
execute as @e[type=snowball,tag=toMove] store result entity @s Motion[0] double 0.02 run scoreboard players get @s x
execute as @e[type=snowball,tag=toMove] store result entity @s Motion[1] double 0.02 run scoreboard players get @s y
execute as @e[type=snowball,tag=toMove] store result entity @s Motion[2] double 0.02 run scoreboard players get @s z
1
12/14/2020 4:27 pm
Level 1 : New Miner
Zai1208
Zai1208 avatar
Also you should add an OnHold tag
1
12/15/2020 12:06 pm
Level 74 : Legendary Programmer
legopitstop
legopitstop avatar
Good idea on the "onHold" tag. I found the same if not similar series of commands, I placed it in the datapack so it will only run when you use the item but with no luck. Mabe I will try placing it in the tick file.
1
12/15/2020 1:26 pm
Level 74 : Legendary Programmer
legopitstop
legopitstop avatar
This is as far as I got. It will follow your rotation but not shoot out. more of just falling on the ground.
1
11/24/2020 3:43 am
Level 32 : Artisan Princess
Kate1902019
Kate1902019 avatar
Can it work with snapshot 20w46a?
That's the 1.17 snapshot I was playing on.
Planet Minecraft

Website

© 2010 - 2022
www.planetminecraft.com

Welcome