#(JustinS) Switching between hotbars and inventories

48 messages · Page 1 of 1 (latest)

dense wing
#

I know about inventory scripts, though can something similar be achieved with hotbars? Im trying to switch between 2 hotbars when the player rightclicks a certain item (which stays in the first slot on both hotbars)

shadow wrenBOT
#

(JustinS) Switching between hotbars

shadow wrenBOT
#

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.

dense wing
#

I cant find anything in the docs about this though

flint jewel
#

Depends on what exactly you are looking for, but you are prob just better off doing an exact give/take on the slots

#

!c give

fringe ruinBOT
# flint jewel !c give
Group

item

Syntax

give [<item>|...] (quantity:<#>) (unlimit_stack_size) (to:<inventory>) (slot:<slot>) (allowed_slots:<slot-matcher>) (ignore_leftovers)

Short Description

Gives the player an item or xp.

Description

Gives the linked player items.

Optionally specify a slot to put the items into. If the slot is already filled, the next available slot will be used.
If the inventory is full, the items will be dropped on the ground at the inventory's location.
For player inventories, only the storage contents are valid - to equip armor or an offhand item, use !command equip.

Specifying "unlimit_stack_size" will allow an item to stack up to 64. This is useful for stacking items
with a max stack size that...

flint jewel
#

!c take

fringe ruinBOT
# flint jewel !c take
Group

item

Syntax

take [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)

Short Description

Takes an item from the player.

Description

Takes items from a player or inventory.

If the player or inventory does not have the item being taken, nothing happens.

Using 'slot:' will take the items from that specific slot.

Using 'flagged:' with a flag name will take items with the specified flag name, see !language flag system.

Using 'iteminhand' will take from the player's held item slot.

Using 'cursoritem' will take from the player's held cursor item (as in, one that's actively being picked up and moved in an inventory scree...

flint jewel
#

give slot:# take slot:#

dense wing
#

I want to be able to switch between inventories, including the hotbar

#

So lets say a player is holding a backpack item, I want their entire inventory to switch when it's rightclicked in their hand

#

They can then move stuff and select stuff and right click the backpack in their hand again to switch back

flint jewel
#

oh well if you just want to swap entire inventories just use the inventory command

#

!c inventory

fringe ruinBOT
# flint jewel !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...

flint jewel
#

inventory set d:<player.inventory> o:<someotherinventory>

dense wing
#

I also tried <inventory[forcepowers_inventory]> and <[forcepowers_inventory]>

#
air|i@stone|;holder=s@forcepowers_inventory;size=27;title=Force
                 Powers;uniquifier=9]'
[09:02:25 INFO]:  ERROR in script 'forcepower_input_script' in queue 'FORCEPOWER_INPUT_SCRIPT_343_DerekMention' while executing command 'INVENTORY' in file '\scripts\Forcepowers.dsc' on line '36' with player 'JustinS_2006'!
                 Error Message: Woah! An exception has been called with this command!
[09:02:25 INFO]: Additional Error Info: Internal exception was thrown!
[Error Continued] java.lang.ArrayIndexOutOfBoundsException

[09:02:25 INFO]: +> [CommandExecutor] (Attempted: INVENTORY set d:<inventory[forcepowers_inventory]> o:<player.inventory>)```
mighty geyser
#

!debug

fringe ruinBOT
# mighty geyser !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!

dense wing
dense wing
#

I changed it to - if <player.inventory> == forcepowers_inventory: - inventory set d:<player.inventory> o:forcepowers_inventory - else: - inventory set d:forcepowers_inventory o:<player.inventory>

#

though I still get the same error

dense wing
#

(JustinS) Switching between hotbars and inventories

errant crow
#

But in this case, if you just want to swap them every time, I think you can just - inventory swap?

#

!c inventory

fringe ruinBOT
# errant crow !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...

dense wing
errant crow
dense wing
#

The swap command asks for a destination and origin

#

So if you set the destination to the players inventory and the origin to the other inventory, then it will only switch that way right?

#

it wont just switch the other way because the destination and origin are the wrong way around

#

And even with the swap command, how do I specify the other inventory, because Im pretty sure thats what was giving the error

#

Also this wont give each player their own editable extra inventory right?

errant crow
#

Well, no, it's a swap - the items in the 2 inventories will be swapped no matter the order they're specified in

#

For the other inventory, assuming this is per-player thing, you'd need to make it per-player in some way - I.e. a note with the player's UUID, a flag on the player, etc.

dense wing
#

why is this so confusing 😕

#

So I need to:

  1. Check if the player has a backpack inventory
  2. If not, make a new empty backpack and note it to that player
  3. Swap the players inventory with the backpack inventory, but keep the backpack item in the first slot in the backpack inventory, and keep it in the same slot that it was previously in, in the player inventory
#

Can anyone please help with this?

dense wing
#

I tried doing it ingame instead:
/ex inventory swap origin:<player.inventory> d:forcepowers_inv<player.uuid> this does something. I see some items in my inventory flickering when running this, though nothing changes.
When I reverse it:
/ex inventory swap origin:forcepowers_inv<player.uuid> d:<player.inventory> it says Im missing the origin????

                 Error Message: Woah! Invalid arguments were specified!
                 Missing origin argument!
[12:43:26 INFO]: +> [CommandExecutor] Usage: 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>)
[12:43:26 INFO]: +> [CommandExecutor] (Attempted: INVENTORY swap origin:forcepowers_inv<player.uuid> d:<player.inventory>)```
#

forcepowers_inv was noted with - note <inventory[forcepowers_inventory]> as:forcepowers_inv<player.uuid>

#
    type: inventory
    inventory: chest
    title: <&9><bold>Force Powers
    gui: false
    slots:
    - [][][][][][][][][]
    - [][][][][][][][][]
    - [][][][][][][][][]
    - [][][][][][][][][]```
dense wing
#

This thread is too chaotic Ill start a new one