#(ctr) Update Shulker item inventory after closing

75 messages · Page 1 of 1 (latest)

rustic echo
#

Hey, i'm trying to update a shulker i opened with on player right clicks block with:shulker_box|*_shulker_box: - inventory open d:<context.item.inventory>

i tried around with using on player closes inventory and grab the contents from there to update it. Can't figure out what to use to adjust the shulker item in my inventory after that.

Full script is: https://paste.denizenscript.com/View/104896

hard muralBOT
#

(ctr) Update Shulker item inventory after closing

hard muralBOT
#

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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

split cypress
#

Doesn't a shulker box does that automatically for you?

#

Ohh

#

ItemTag.Inventory is deprecated, so use ItemTag.inventory_contents> instead and open a Virtual Inventory which you fill with the inventory_contents of the shulker box.

#

!lang Virtual Inventory

tender sigilBOT
#
Possible Confusion

Did you mean to search for virtual inventories?

tender sigilBOT
# split cypress !lang Virtual Inventory

Virtual inventories are inventories that have no attachment to anything within the world of Minecraft.
They can be used for a wide range of purposes - from looting fallen enemies to serving as interactive menus with item 'buttons'.

In Denizen, all noted inventories (saved by the Note command) are automatically converted into a virtual copy of the saved inventory.
This enables you to open and edit the items inside freely, with automatic saving, as if it were a normal inventory.

Noting is not the only way to create virtual inventories, however.
Using 'generic' along with inventory properties will allow you to create temporary custom inventories to do with as you please.
The properties that can be used like this are:

size=<size>
contents=<item>|...
title=<title>
holder=<inventory type>

Fo...

Group

Inventory System

split cypress
#

Afterwards, when the player closes the inventory, you can adjust the players item in hand with the inventory_contents of the closing inventory.

#

!m inventory_contents

tender sigilBOT
split cypress
#

!m item.inventory_contents

tender sigilBOT
rustic echo
#

Huh... not sure where i'm stuck...
Using- define Contents <player.item_in_hand.inventory_contents> does seem to make the correct list, opening it via
- inventory open d:generic[size=27;title=<player.item_in_hand.display>;contents=<[Contents]>] can't read the list tho

split cypress
#

!t inventory.list_contents

tender sigilBOT
rustic echo
#

Ah the <context> one is still old, since i can't even open it, ignore the lower part lol

rustic echo
split cypress
#

Where do you put the quotes

rustic echo
#

well like "d:generic[size=27;title=<player.item_in_hand.display>;contents=<[Contents]>]" as in the Virtual Inventories example

split cypress
#

They're not needed at that line

rustic echo
#

but there's spaces in the example tho

split cypress
#
  • inventory open d:generic[size=27;title=Shulker Box;contents=<[Contents]>]
    You need them at this line ^
#

because this line has indeed a space

rustic echo
#

oh

#

aaaaand it works

split cypress
#

And if you look at the debug you can see that it requires quotes

rustic echo
split cypress
rustic echo
#

yeah i've read that multiple times but i was blind i guess

#

thanks alot ♥

rustic echo
#

No chance i'm figuring that out... What can i use to adjust the context shulker now?
I've tried like 50 different things now EsFpRllVcAAUKyH

split cypress
#

I already told u

rustic echo
#

you mean list_contents?

rustic echo
#

i've tried like 20 different variations of what you told me there ^^

#

only thing that didn't error at least was /ex adjust <player.item_in_hand> inventory_contents:<list[diamond|air|diamond]> but it doesn't adjust anything

split cypress
#

Doing 20 different variations of things of that thing that was told you isn't the thing that was told you. But eh

#

!guide common mistakes - adjust is not for items

tender sigilBOT
#
Possible Confusion

Did you mean to search for common mistakes - the adjust command is not for items/materials/etc.?

split cypress
#

You switched from inventory adjust to adjust for some reason

rustic echo
#

but i'm trying to adjust the inventory not the item? or am i misunderstanding Note that this is only for items, it does NOT adjust the inventory itself. Use Command:adjust to adjust an inventory mechanism.

split cypress
#

You adjust the item, not the inventory.

rustic echo
#

oh

#

right

split cypress
#

Afterwards, when the player closes the inventory, you can adjust the players item in hand with the inventory_contents of the closing inventory.

rustic echo
#

i think i got it, thanks alot

#

Hopefully last question: What could i use to cancel people from placing shulkers inside that generic inventory?
i know there is on player clicks in inventory, but since we're not giving it a name here i'm not sure how to solve that

#

Oh also... when just opening my normal inventory on player closes inventory in:Hub: fires and empties the shulker in my hand.. i guess that could be prevented with the same solution as my first last question?

tough gate
split cypress
#

Set the inventories holder to a shulker_box

#

when creating the virtual inventory, so shulker_box rules apply

split cypress
#

that event takes id_holders as input too

#

!t inventory.id_holder

tender sigilBOT
split cypress
#

!t inventory.inventory_type

tender sigilBOT
rustic echo
#

thanks alot