Skip to content

Items API#67

Open
SpaceWalkerRS wants to merge 3 commits into
gen2from
items
Open

Items API#67
SpaceWalkerRS wants to merge 3 commits into
gen2from
items

Conversation

@SpaceWalkerRS
Copy link
Copy Markdown
Member

The purpose of this API is to provide a hook for registering items.

Features

Item Registration

The REGISTER_ITEMS event is invoked right after Vanilla item registration has completed. Custom item registration should be done in a listener to this event.

The ItemRegistry class provides static access to the item registry:

int getId(Item)
NamespacedIdentifier getKey(Item)

Item getItem(int)
Item getItem(NamespacedIdentifier)

Set<NamespacedIdentifier> keySet()

// 17w46a-
Item register(int, NamespacedIdentifier, Item)
// 17w47a+
Item register(NamespacedIdentifier, Item)

1.6 And Below

In Minecraft 1.6.4 and below, there was no item registry. Instead, items were stored in a single array. This API provides its own registry for these versions, and even registers all Vanilla items using the relevant namespaced IDs from 1.7.

@SpaceWalkerRS SpaceWalkerRS force-pushed the items branch 3 times, most recently from 6eae7cd to 5214e42 Compare May 30, 2026 15:21
@SpaceWalkerRS SpaceWalkerRS force-pushed the gen2 branch 3 times, most recently from 214d13e to 8f7ec06 Compare May 31, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant