#Create a permanent way to store a players hotbar

1 messages · Page 1 of 1 (latest)

slender fox
#

@craggy ravine

craggy ravine
#

Okay

slender fox
#

I can do it temporily

craggy ravine
#

so is this system to be used for somewhere with a limited num of items?

slender fox
#

by making an array and storing it in there

#

yeah

#

just the players hotbar

craggy ravine
#

no

slender fox
#

so a list of 9

craggy ravine
#

I mean like

#

could you (if you needed to) list every single item the player could get

#

wait do item ids work with bedrock?

slender fox
#

idk

#

I'm new to scripting

craggy ravine
#

same

slender fox
#

but looking at the player inventory documentation and stuff you can grab items and I assume they can be stored

craggy ravine
#

you could store in a tag

#

like the tag would be formatted with the exact info

slender fox
craggy ravine
#

/tag @s add "1,diamond_pickaxe,0"

#

then

#

you divide that into an array

#

wait I wrote it wrong

#

Im sorry

#

/tag @s add "item:,1,diamond_pickaxe,0"

#

then you get all player tags that start with item:

#

divide them into arrays

#

then
array[1] = slot num 1-9
array[2] = item name
array[3] = item data (durability)

#

would that work?

slender fox
#

don't know

craggy ravine
#

I mean

#

I would assume

slender fox
#

this is all the info about itemstacks which it seems how scripting stores info

craggy ravine
#

ngl

#

much better to store in mc

#

from my experience (which isnt much)

slender fox
#

so data actually represents the durability then?

craggy ravine
#

yes

#

data 0 is untouched

slender fox
#

oh damn

craggy ravine
#

after that its how much damage it has taken

slender fox
#

that would probs work then

#

well at least storing

craggy ravine
#

wait

#

I just realized that there is an issue with removing the tags

#

nvm

#

you can remove all tags starting with item: before ever updating the storage

slender fox
#

probs just use something like player.getTags

#

maybe not like that

#

but the way you say would work

craggy ravine
#

I mean

#

it seems most efficient

slender fox
#

I think anyways

#

yeah

#

I'll see if I can get something to work

#

ty for the help