#(fu_meng) Using the inventory set command to place an item into a GUI can cause the sorting of the

24 messages · Page 1 of 1 (latest)

sage cargo
#

Using the inventory set command to place an item into a GUI can cause the sorting of the item's NBT keys to change, which may prevent the item from stacking with the original item.

Here's an example to illustrate this. The NBT data below is before and after the item is placed, with the content remaining the same but the order changed.
``
Fu_Meng has the following entity data: {Slot: 0b, id: "minecraft:paper", tag: {NeigeItems: {id: "测试配方", data: "{}", hashCode: 80424972}, display: {Name: '{"text":"","extra":[{"text":"测试配方","obfuscated":false,"italic":false,"underlined":false,"strikethrough":false,"color":"green","bold":false}]}'}, "材料": {"测试2": 10, "测试1": 10}}, Count: 1b}

Fu_Meng has the following entity data: {Slot: 1b, id: "minecraft:paper", tag: {NeigeItems: {id: "测试配方", data: "{}", hashCode: 80424972}, display: {Name: '{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"测试配方"}],"text":""}'}, "材料": {"测试2": 10, "测试1": 10}}, Count: 1b}


This is my code:
  • define tempitem <context.cursor_item>
  • adjust <player> item_on_cursor:<context.item>
  • inventory set o:<[tempitem]> slot:<context.slot> d:<player.open_inventory>
pallid mistBOT
#

(fu_meng) Using the inventory set command to place an item into a GUI can cause the sorting of the

pallid mistBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

idle solar
#

!debug

steep havenBOT
# idle solar !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

shy helm
#

Also, additionally, when sharing scripts, help us help you by pasting your script to Denizen's paste tool.

#

!haste

steep havenBOT
sage cargo
sage cargo
shy helm
#

Have you considered inventory script containers?

#

Line 22: You are not passing along any definitions with your command on line 17.

Line 34: <ni_item[测试物品]> ??? Not sure what ni_item is, but I'm fairly sure you don't need that constructor.

Line 28, and 38 seem to do the same thing.

Line 39-48 can be achieved with procedural logic in an inventory script container.

sage cargo
#

The <ni_item[ItemsId]> is part of an extension plugin that I have written myself.

      // <--[tag]
        // @attribute <ni_item[<name>]>
        // @returns ItemTag
        // @plugin Depenizen, NeigeItems
        // @description
        // Returns an ItemTag of the named NeigeItems item.
        // -->

This is not very important; let me give you a simpler example:

setitem_test:
    type: world
    debug: false
    events:
        on player clicks in inventory:
        - inventory set o:<player.item_in_hand> d:<player.open_inventory>

The NBT of the item has not changed, but the order of the content has changed, which prevents it from stacking with the original item. This is just an example. For instance, setting a flag for the player named "test_item" with a value of the current item in hand. After that, I retrieve this item through "test_item," and the content order of the item's NBT is different from the original.

There are many such cases. As long as the item is retrieved based on a template and then regenerated or manipulated through Denizen, the order of the NBT content will be different from the original, as Denizen will sort the NBT content in its own way.

My English is not very good, and I may not express myself clearly.

manic vine
wind marshBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@sage cargo

wind marshBOT
#
Marked Invalid

Thread closed as invalid.

sage cargo
#

My goal is to move items within the inventory while ensuring that the original order of the item's NBT fields is maintained. However, using the command inventory set slot:<slot> o:<item> can result in a change in the order of the item's NBT data.

wind marshBOT
#
Thread Reopened

Thread was manually reopened by @sage cargo.

wind marshBOT
#
Changed to Help/Support

Thread is now a Help/Support thread. A helper will check your thread when available.

wind marshBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@sage cargo