Interface IPartItem<P extends IPart>
- All Superinterfaces:
net.minecraft.world.level.ItemLike
When implementing a custom part, you must create an item to both represent the part in NBT and Packet data, and to
actually place the part onto the bus. Implement this interface on your part
Item.
To help with placing parts onto buses, use PartHelper.usePartItem(UseOnContext) to implement your items
Item.useOn(UseOnContext) method.-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable IPartItem<?> byId(net.minecraft.resources.Identifier id) Retrieve a part item by itsid.static @Nullable IPartItem<?> byNetworkId(int id) Retrieve a part item by itsid.create a new part INSTANCEstatic net.minecraft.resources.Identifierstatic intgetNetworkId(IPartItem<?> item) Methods inherited from interface net.minecraft.world.level.ItemLike
asItem
-
Method Details
-
getPartClass
-
createPart
-
getId
- Returns:
- The registry id for this item.
-
getNetworkId
- Returns:
- The registry id for this item, suitable for network serialization.
-
byId
-
byNetworkId
-