#Chest UI

1 messages · Page 1 of 1 (latest)

safe abyss
#

After pulling my hair out for a few days trying to figure out Jason UI, I finally managed to make something cool! With help from LeGend077 & their original form design as a jumping off point (https://github.com/LeGend077/packs/tree/main/Chest UI - Server Form), I created a chest UI that is almost indistinguishable from an actual chest. With settable UI titles, item slots, item names, item lores, item stack size, and item icons, this ui is fully customizable and is not laggy at all, unlike most chest UIs available! This also comes with a handy script extension, to make building one of these exactly like a Modal Form, the form we all know and love.

Some things I would like to add to this in the future are:

  • Functioning inventory section (it’s just for looks at the moment)
  • Customizable background (Using the vanilla ui nineslice, as right now it’s just a static texture)
    But for now, I’m more than happy with this! Enjoy!

https://github.com/Herobrine643928/Chest-UI

#

Oops, forgot to add a picture of the script form builder.

finite gazelle
#

Amazing!

vagrant sonnet
#

Woahhh

#

That's sweeeeet!

#

I love Jason ui

#

Thank you Jason

regal mango
#

amazing

#

@gleaming bramble

safe abyss
vagrant sonnet
#

Yeah I most definitely hate it too

#

It absolutely sucks

#

Waiting on ore ui 🥰

echo locust
#

So , how do you open the form with a npc?

safe abyss
#

Made by Satan himself to punish the sinners

vagrant sonnet
#

I think I know who made it

safe abyss
vagrant sonnet
#

@young star I'm blaming you for this one too!

vagrant sonnet
#

You're getting cross-server blame here Thomas

safe abyss
#

Forgot to mention- the included manifest is for preview, to make it for stable mc, just decrease the server version to 1.4.0-beta

scenic helm
#

I would have not been able to do this, without your contribution!

gleaming bramble
#

niceee about to drop hella updates

gleaming bramble
gleaming bramble
scenic helm
#

do you mean slots?

shadow elk
gleaming bramble
scenic helm
#

uh no it'll be a rewrite then

gleaming bramble
#

?

scenic helm
#

but yes nice idea

gleaming bramble
#

oh okay, if this is using action form then it should be easy to generate

#

json ui is very easy for this stuff as in collections

scenic helm
gleaming bramble
#

okay

gleaming bramble
scenic helm
#

github/name?

gleaming bramble
safe abyss
#

Dynamic sizing would be very cool

#

And showing the inventory of the player below the form, instead of just the empty inventory

shadow elk
safe abyss
#

Dunno how to

gleaming bramble
#

Like let’s say we wanted to “put a item in the gui” they could click on a item in there inventory.

safe abyss
#

There’s always the option of copying the inventory over into buttons, but that’s not great

safe abyss
#

I was looking at this

#old-json-ui message
To display the inventory

gleaming bramble
#

I’ll release a update to the GitHub soon

safe abyss
#

Changing anything? 👀

obsidian plinth
#

nice broski

oak cobalt
#

how well does it play with mobile?

safe abyss
#

Haven’t tested it yet 😬

oak cobalt
#

if you use the hover to display the tooltip, it should behave pretty well

#

keyword: should :)

plucky raft
#

omg what scripts do

median quartz
#

cool👀

bleak lynx
#

@safe abyss

#

Why is this happening?

#

after using compass

safe abyss
#

Does nothing happen, or does the menu just not show up?

bleak lynx
#

menu not visible

safe abyss
#

Did you equip the resource pack?

bleak lynx
#

there is no problem with the script, it may be a problem with the resources pack

bleak lynx
safe abyss
#

Hmm… what device?

bleak lynx
#

Samsung

safe abyss
#

Might be the problem.. I never tested it on mobile

bleak lynx
#

Hm

#

can you send the resources package from dm

#

maybe the error is there

#

i solved the problem

safe abyss
#

Ah nice

#

What was wrong?

bleak lynx
#

Resource pack

#

I deleted a few things from server_form.json

#

I renewed the pack and it worked

safe abyss
#

Thanks for letting me know 👍 updated the GitHub, and tested it on iOS. Seems to be good now

#

It’s a bit goofy with viewing each item’s name & description, but it’s not bad

safe abyss
oak cobalt
obsidian plinth
#

is that webstorm??

safe abyss
#

GitHub

obsidian plinth
#

lol

#

this looks hella nice

#

is there any extension for vs code with this

#

cuz it's like a real programmer view

safe abyss
#

Not a clue lol

ebon rock
#

sry for the question
can you do like this? i tried myself but it gave me errors


export class chestForm {
  constructor() {
    this.form = new ChestFormData();
  }

  setTitle(txt) {
    this.form.title(txt);
  }

  addButton(slot, itemName, itemDesc, iconPath, stackAmount) {
    this.form.button(slot, itemName, itemDesc, iconPath, stackAmount);
  }

  show(player) {
    return new Promise((resolve, reject) => {
      this.form
        .show(player)
        .then((res) => {
          resolve(res);
        })
        .catch((err) => {
          reject(err.stack);
        });
    });
  }
}```
safe abyss
#

What error exactly?

#

And the import points to the correct location, yeah?

ebon rock
safe abyss
#

Hmm

#

Are you inputting the item description as an array of strings?

ebon rock
#

string i guess

#

now i know

safe abyss
#

It’s meant to be inputted as an array of strings, as it’s like the “lore” of the item

ebon rock
#

yeah

#

now it worked

safe abyss
#

The .join() in the extension file would be throwing errors there

ebon rock
#

thanks for the help

safe abyss
#

You could change the chest form names themselves, if you want; you don’t have to make a new class for it

ebon rock
#

thank you

limber bobcat
#

@safe abyss question about js, e.g when you put item in e.g. slot 10 (1row,2column) do you fill previous 9 slots by empty buttons right?

obsidian plinth
#

not entire resource pack

#

it's made by [@] LeGend

#

so you should ask him

#

ig

bleak lynx
#

@safe abyss Why are the items in your inventory not appearing on the menu?

safe abyss
#

The inventory area is purely cosmetic at the moment- but hopefully items will show in the future

oak cobalt
#

i wonder, is it possible to hide the inventory area?

safe abyss
#

I can make an alternative version that does that, yes

oak cobalt
#

would be cool to have until (if) you make the inventory panel actually work! looks much cleaner with just the chest menu than with a broken inventory

oak cobalt
#

@safe abysswhat size options are available for the ui?

#

they seem to be "small" and "large"

safe abyss
#

Yeah, that’s all there is for now

agile ginkgo
#

Makes me nostalgic seeing the Cosmic Prisons structure and the classic chest UI :)

safe abyss
#

Well, I am trying to recreate cosmic prisons 🙂

bleak lynx
#

you can use this

viral stone
#

What version will it run on?

scenic helm
azure spire
#

how does the hovering work?

safe abyss
#

Alternate version is now available on the git, which removes the inventory part 👍

jagged quiver
#

dammnm nice

regal mango
#

masterpiece

safe abyss
#

After a lot of head-scratching & hair pulling, isometric blocks & animated enchant glint is now possible with this pack!
Make sure you configure the number_of_1_16_100_items constant in scripts/extensions/forms.js to the number of 1.16.100+ items in your applied pack(s), otherwise the textures will not match up!

gleaming bramble
#

wheres the update

safe abyss
#

On the GitHub

regal mango
regal mango
#

suggestion: maybe a semi transparent black background

scenic helm
regal mango
#

the one like black

#

behind the gui

regal mango
# safe abyss

as you can see in this video theres no black background

scenic helm
#

ohh, Okay. Will do. thanks

regal mango
#

yeah i hope you understand what im trying to say lol

#

thanks

scenic helm
#

yeah that vignette or something, i got it

regal mango
#

also one more maybe instead of checking if it start with minecraft:
it checks if the thingy exist in the map (for typeid to id) this way people can add their own custom items or aux or something but its up to you (its easy to do it i think)

scenic helm
regal mango
#

no i mean something else

#

wait

scenic helm
#

This is what I know. Moreover, about scripts, Herobrine will tell ¯_(ツ)_/¯

regal mango
#

oh yeah

scenic helm
#

i know?

#

How to get the aux id in the first place

regal mango
#

resource pack that shows aux id (number to string)

scenic helm
#

because the buttons on server forms are just buttons not items.

regal mango
#

ill explain later

scenic helm
#

okay

gleaming bramble
regal mango
scenic helm
gleaming bramble
regal mango
#

not me

regal mango
gleaming bramble
scenic helm
#

textures/item/custom_item_texture

gleaming bramble
#

Working on a held item system with this... ive completly redone the backend into to typescript also improving the code alot better

#

im going to also add alot more chest gui types to this

#

single

vagrant sonnet
#

ugh this ui system is so nice

regal mango
# gleaming bramble

you should just make a way to set the slot into blank (grey) instead of doing that

#

via script

gleaming bramble
#

It’s taking some work I have to do some ui magic

regal mango
#

that would be hard to display the player inventory item description

gleaming bramble
regal mango
#

imagine we can close the form with script

#

there will be so many cool possibility like trade system, crates animation, etc

gleaming bramble
safe abyss
#

Those were from the official ms website

#

A few of them I inferred from just displaying all the IDs (concrete & shulkers)

gleaming bramble
#

ive been working on geting the inventory to render

safe abyss
#

poggers

gleaming bramble
#

but for some reason some of my custom items, render in

gleaming bramble
#

i need to figure out how you soruced those things

safe abyss
#

I just pushed a commit that finally fixes the rest of the IDs- the ms site above has the debug stick on it, which shifted all IDs up by one.

gleaming bramble
#

yeah ive been getting alot of problems with the icon rendering

safe abyss
#

Should be all good now, unless you have experimental items

#

Which is what the number_of_1_16_100_items constant in the forms.js file is for

gleaming bramble
#

so am i supposed to enter that number in?

safe abyss
#

ye

gleaming bramble
#

ohh maybe you should document that

safe abyss
#

The game inserts experimental items directly after the ID of 256, and shifts the vanilla ones up as a result

safe abyss
gleaming bramble
#

how about this

safe abyss
#

hmm

#

well, no

gleaming bramble
#

it will generate the items for you

safe abyss
#

because non-experimental items are placed in the high negatives

#

and don't shift the IDs

gleaming bramble
#

oh well all the items in my pack are 1.16.100 i would rather do this then to count them

safe abyss
#

alright

#

You can also just input an item, and see how much it was shifted by

gleaming bramble
#

this is still messed up

#

it has spawn eggs in here...

#

this is my inventory

safe abyss
#

Like input 'minecraft:zoglin_spawn_egg' (ID of 500) and see what item actually appears instead

gleaming bramble
#

its empty

safe abyss
#

Try 'minecraft:brown_dye' maybe? (300)

gleaming bramble
safe abyss
#

uhhh dunno

#

maybe not

gleaming bramble
safe abyss
gleaming bramble
safe abyss
#

add to world, right-click with compass, exit & re-enter menu to view next page of IDs

#

Might want to disable all other UIs tho, as they will overlap

#

minecraft:apple is 257, and custom items will be inserted before it

#

So you can check the shift with that UI'

scenic helm
#

It is getting a bit complicated though

safe abyss
#

type IDs are finally fixed

#

Not much I can do about custom items

scenic helm
safe abyss
#

Debug stick was in there for some reason

gleaming bramble
scenic helm
safe abyss
#

ID to aux ID

gleaming bramble
#

Okay ive figured out how they index it

#

minecraft:reserved6 is the last index at 255 then, it goes into the items folder, and starts at the first item, then starts going through the folders, then it goes back to the remaining items.

#

So @safe abyss how do i get the aux for items that are above 1.16.100

safe abyss
#

aux value is always the same

#

* 65536

gleaming bramble
#

but also why is there spots where there ids repeat

safe abyss
#

like where?

gleaming bramble
safe abyss
#

ah

gleaming bramble
#

and doors

safe abyss
#

One is the one with no data value

gleaming bramble
#

more stuff like that

safe abyss
#

One is the one that was flattened

#

So split across multiple IDs

gleaming bramble
#

yeah but theres duplicates

safe abyss
#

ohh yeah I see what you mean

#

These here are supposed to be white_xxx

#

This one here is the default one

gleaming bramble
safe abyss
#

yeah, I'll fix that here

#

Any other duplicates?

#

shulker, concrete, ...?

gleaming bramble
#

just convert it too a object, and let js throw errors

#

this is what i got so far

#

i need icons fixed

#

this is what my inventory looks like

#

so there a big diffrence

safe abyss
#

Probably because walls aren't separate items, they are all under one item with a data value

#

The custom ones... idk

gleaming bramble
safe abyss
#

no

gleaming bramble
#

oh nvm there way diffrent

#

@safe abyss so im having problems with the inventory rending

#

for some reason, the more items i have in the chest, it keeps pushing the bottom items over as if there on the same grid

safe abyss
#

hmm

gleaming bramble
#

what im doing is spliting up the rendering like this

  "inventory_item": {
    "type": "stack_panel",
    "size": [18, 18],
    "layer": 2,
    "controls": [
      {
        "inventory_button@chest_ui.inventory_button": {
          "$allowedPrefix": "inv:"
        }
      }
    ]
  },
  "hot_bar_item": {
    "type": "stack_panel",
    "size": [16, 18],
    "layer": 2,
    "controls": [
      {
        "inventory_button@chest_ui.inventory_button": {
          "$allowedPrefix": "hot:"
        }
      }
    ]
  },
  "chest_item": {
    "type": "stack_panel",
    "size": [18, 18],
    "layer": 2,
    "controls": [
      {
        "inventory_button@chest_ui.inventory_button": {
          "$allowedPrefix": "cht:"
        }
      }
    ]
  }```
#

then the allowed prefix, tells the json ui if a button can render for it

#

but even if it cant render its still taking up a grid spot

gleaming bramble
#

i got it to render right

#

now i just need to fix sizing

#

i now just have it as one big grid, and im just filling it

gleaming bramble
#

okay i got conditonal rendering for the offsets

#

but theirs a problem when hovering over the item, the actual button location isnt applied to the offset

#

like how i can i have my cursor above the item, and it grabs the item

gleaming bramble
regal mango
#

can you send video

gleaming bramble
#

Of what?

regal mango
gleaming bramble
#

I meant it’s offseted weird

regal mango
#

oh

gleaming bramble
#

@safe abyss i need a fix for these icons

gleaming bramble
#

Ive finished the system, but i need icons to be fixed

safe abyss
#

Items with data values cannot be fixed at all, as they do not exist in the ID system

gleaming bramble
#

i dont care about the data value ones

safe abyss
#

All vanilla IDs are correct, and are on the GitHub. Custom items have to be manually added & vanilla ones shifted, if the custom items are experimental

gleaming bramble
safe abyss
gleaming bramble
#

that would allow you to correctly get the shifted items, and get the custom items

safe abyss
#

IDs can’t be gotten via scripts / behaviors, as far as I know

gleaming bramble
safe abyss
#

I mean, sure

gleaming bramble
#

also does it index blocks?

safe abyss
#

Haven’t a clue. I haven’t dug that deep into it.

gleaming bramble
#

blocks, items, and spawn eggs would all need to be scaned to create a list

gleaming bramble
safe abyss
#

I do know all blocks start at an ID of -745 and go increasingly negative
And non-experimental items start at 716 and go increasingly positive (716 assumes no shift from experimental items)

gleaming bramble
#

also what are the ids for the items above 1.16.100

gleaming bramble
safe abyss
#

I’d like to say yes, but I haven’t tested it with anything higher than 1.16.100 items

gleaming bramble
#

what do you know about spawn eggs

safe abyss
#

Literally nothing

gleaming bramble
safe abyss
#

Because that’s just what it is

gleaming bramble
#

i have it decreasing from -745 to show all blocks

#

this is my blocks folder

gleaming bramble
gleaming bramble
#

BOOOm i finished it, i made a generator that loops through the items directory

gleaming bramble
#

@safe abyss after 1070 starts custom entity spawn eggs

safe abyss
#

Good heavens

gleaming bramble
#

so now i have to figure that out

bleak lynx
#

@safe abyss