Skip to content

Held item component - #3697

Open
Crepestrom wants to merge 9 commits into
PixelGuys:masterfrom
Crepestrom:Held-item-Component
Open

Crepestrom wants to merge 9 commits into
PixelGuys:masterfrom
Crepestrom:Held-item-Component

Conversation

@Crepestrom

Copy link
Copy Markdown
Contributor

for #2734

adds a held item component that syncs and tracks what item the player has selected

@Crepestrom
Crepestrom marked this pull request as ready for review October 10, 2026 23:25
@Wunka Wunka moved this to Low Priority in PRs to review Oct 13, 2026
// ############################# Client only stuff ################################
pub const client = struct {
const Component = struct {
heldItem: items.Item,

@Wunka Wunka Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it not make more sense to have the index into the inventory here? This has duplicated the saving of the item. this could lead to out of sync issues. (the inventory was changed through a sync command, but the held item sync command has not yet been run / was not even triggered because of some misconfiugration
In my opinion (just mine, not a fact):
The general inventory is in a component and this is an index into that components items.
For example a system that renders the player would use both components to get the item and then display it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think the client knows whats in other players inventories is the issue i think think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok it also references a InventoryAndSlot now

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Low Priority

Development

Successfully merging this pull request may close these issues.

2 participants