ItemJoin

ItemJoin

157k Downloads

Assistance with NBT

labmonjos opened this issue ยท 3 comments

commented

Server Version

paper 1.20.1 build 169

Resource Version

6.0.2

Dump Information

https://pastebin.com/j2WPhBMn

Describe The Problem

I need help creating a NBT tag for the following vanilla tag: CanDestroy

The behavior i'm seeing is that Itemjoin doesnt like brackets in it's properties field. This particular tag requires brackets to look like the following:
tag: {CanDestroy: ["minecraft:dirt"]}

since this doesnt work, the whole tag disappears from ./data get entity @s BUT modifying the properties field to say:
'eebydeeby: ["minecraft:dirt"]' (even though this is wrong) shows that an extra pair of ' is added when doing a /data get entity @s.

Is there a way to format this properly?

Additional Context

No response

Checklist

  • I am running latest version of this resource.
  • I have read the wiki to make sure it's not an issue with configuration.
  • I ticked all of these boxes without actually reading them.
  • I have checked that my help request is unique and another request does not exist.
  • I acknowledge this is not a bug report and is instead a help request.
commented

I apologize for taking so long to respond to this issue, I had done some testing previously but couldn't figure out why it wasn't functioning properly.

It turns out this type of NBT data is on a different "branch" (list) than where I set the custom nbt data so it's a bit different than custom properties.

I will need to move this to a feature request.

Again I apologize for being so slow on this.

commented

The current config:
image

the eebydeeby:
image

I have tried the following for 'properties' with no success:
CanDestroy:dirt
CanDestroy:["minecraft:dirt"]
CanDestroy:"minecraft:dirt"
CanDestroy:"dirt"

commented

I was able to work around this by not used the 'properties' field but instead using a repeating command block and a datapack with a item_modifiers json file:

Command block:
execute as @a[nbt={Inventory: [{tag: {"ItemJoin Name": "master-shovel"}}]},nbt=!{Inventory: [{tag: {"ItemJoin Name": "master-shovel", CanDestroy: ["minecraft:snow_block"]}}]}] run item modify entity @s hotbar.0 lobbykit:mastershovel

mastershovel.json file in datapacks\lobbykit\data\lobbykit\item_modifiers

{
  "function": "minecraft:set_nbt",
  "tag": "{CanDestroy:[\"minecraft:snow_block\"]}"
}

These two steps will force the CanDestroy tag on slot0 if the name of the itemjoin name is what you set up in the items.yml file (and will do it once). Kinda janky but it works. let me know if theres a more elegant way to do this thru the plugin's config. Otherwise close as solved?

image