#Display problem with my UI
1 messages · Page 1 of 1 (latest)
Can anyone help me ?
can you give us the code you used so we can help you fix the issue?
you have to shift the aux id offset by the ammount of custom items you have in your pack
async function showPlayerInventory(sender, target) {
const inventory = target.getComponent('inventory').container;
const invForm = new ChestFormData('large').title(`Inventory of ${target.name}`);
for (let i = 0; i < inventory.size; i++) {
const item = inventory.getItem(i);
if (!item) continue;
invForm.button(i + (i < 9 ? 36 : 0), item.nameTag ?? item.typeId, item.getLore(), item.typeId, item.amount);
}
await invForm.show(sender);
}
What do you mean ? Do you have an example ? I don't understand 😅
are u using custom items?
No just Herobrine UI for the ChestFormData
than idk ,better ask the owner from pack
Why i + (i <9 ? 36 : 0) ?
This corresponds to the slots where the contents of the player's inventory will be displayed in my UI
And as this is displayed in a UI similar to a large chest interface, and this slot selection centers the player's inventory in this UI