#(yyykilla_3) Limit the movement of items across the slots

37 messages · Page 1 of 1 (latest)

prisma whale
#

Hey, how can i make that if player shift clicks on item, it will go only in specific slots and not other?
Empty areas of inventory is fillers, so there's only 9 slots available for items, and i need to restrict that down to six

willow yarrowBOT
#

(yyykilla_3) Limit the movement of items across the slots

willow yarrowBOT
#

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.

dreamy parcel
#

Hmmm.

#

This is a custom inventory from the looks, I'm assuming a chest inventory.

#

If I'm correct, it'll try to find the first empty slot available and put it in unless it's a special inventory like a furnace with fuel/food intake.

#

You're either going to want to check the first empty slot of the inventory, and cancel the event and manually move the item yourself.
Or just cancel the event and move the item yourself anyways while checking if the proper slots are empty.

#

!t inventorytag.first_empty

ionic reefBOT
dreamy parcel
#

!c inventory

ionic reefBOT
# dreamy parcel !c inventory
Group

item

Syntax

inventory [open/close/copy/move/swap/set/keep/exclude/fill/clear/update/adjust <mechanism>:<value>/flag <name>(:<action>)[:<value>] (expire:<time>)] (destination:<inventory>) (origin:<inventory>/<item>|...) (slot:<slot>)

Short Description

Edits the inventory of a player, NPC, or chest.

Description

Use this command to edit the state of inventories.
By default, the destination inventory is the current attached player's inventory.

If you are copying, swapping, removing from (including via "keep" and "exclude"), adding to, moving, or filling inventories,
you'll need both destination and origin inventories.

Origin inventories may be specified as a list of ItemTags, but destinations must be actual InventoryTags.

Using "open", "clear", or "update" only require a destination.
"Update" also req...

dreamy parcel
#

Which sounds like the exact same thing that I just said, but the overall goal is the same.

brisk plaza
#

If you`re using 1.21.4+ version, you can place on "unused" slots any item with component "hide_tooltip" - https://minecraft.wiki/w/Data_component_format#tooltip_display

Minecraft Wiki

Data components, or simply components, are structured data used to define and store various properties. They are used on items, where they are referred as item components or item stack components, and block entities, partially replacing NBT format.
Data components are used in various places, including the player's inventory, container block enti...

dreamy parcel
brisk plaza
#

You can put in unused such items and then minecraft itself will put in the right slots

dreamy parcel
#

But what about the other slots that are suppose to take in different items from the looks of things? Are you suggesting those should be filled with no tooltip items as well?

brisk plaza
#

Slots that should accept items will remain empty, and where slots do not accept items, there will be the item with the desired component

dreamy parcel
#

If the first three inventory slots that they've circled are filled, then a shift clicked item will go into the far right inventory slot if it's not currently filled.

#

Same with the bottom row.

brisk plaza
#

I'm a little confused about what you wrote

dreamy parcel
#

The original user is trying to make it so when shift clicking an item, it will only go in those six slots.

On the assumption that this isn't a mod and is a denizen custom inventory using a 36 slot inventory, if those first three slots are filled with items and they shift-click an item from the player inventory, it will go onto the far right slot that's X'd off currently in their preview.

#

I know what you're trying to get across though, about the spaces inbetween the slots that aren't suppose to show at all.

brisk plaza
#

I haven't read what you wrote yet, but all that circled in blue should be filled with items with the hide component

dreamy parcel
brisk plaza
#

but the far right slot would be a problem. it would work perfectly for the first three slots

prisma whale
#

Okay, i didnt thought that shift click is ALWAYS a move event

#

you cant shift click without wanting to move items

dreamy parcel
#

A suggest was still given regarding this.

prisma whale
dreamy parcel
#

Yeah. Cancel item, inventory set the clicked slot to air (define item before to preserve item data), inventory set to the proper slot that was empty.

This is gonna get a little more complicated when the inventory slot isn't empty, but isn't completely full of an items quantity that can still be accepted, so you'll need to compensate for that.

prisma whale
#

okay

#

thanks!