Package net.minecraft.item
Class NetworkSyncedItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.NetworkSyncedItem
- All Implemented Interfaces:
ItemConvertible
,ToggleableFeature
- Direct Known Subclasses:
EmptyMapItem
,FilledMapItem
Represents an item which can contain extra data that is synced to the client.
- Mappings:
Namespace Name named net/minecraft/item/NetworkSyncedItem
intermediary net/minecraft/class_1762
official csz
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings, Item.TooltipContext
-
Field Summary
Fields inherited from class net.minecraft.item.Item
BASE_ATTACK_DAMAGE_MODIFIER_ID, BASE_ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_MAX_COUNT, ITEM_BAR_STEPS, MAX_MAX_COUNT
Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateSyncPacket
(ItemStack stack, World world, PlayerEntity player) Creates a packet that syncs additional item data to the client.boolean
Returns whether the item needs to sync additional data to clients.Methods inherited from class net.minecraft.item.Item
appendTooltip, asItem, byRawId, canBeNested, canMine, canRepair, finishUsing, fromBlock, getAttributeModifiers, getBonusAttackDamage, getBreakSound, getComponents, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getItemBarColor, getItemBarStep, getMaxCount, getMaxUseTime, getMiningSpeed, getName, getName, getOrCreateTranslationKey, getRawId, getRecipeRemainder, getRegistryEntry, getRequiredFeatures, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isCorrectForDrops, isEnchantable, isItemBarVisible, isUsedOnRelease, onClicked, onCraft, onCraftByPlayer, onItemEntityDestroyed, onStackClicked, onStoppedUsing, postDamageEntity, postHit, postMine, postProcessComponents, raycast, toString, usageTick, use, useOnBlock, useOnEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Constructor Details
-
NetworkSyncedItem
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/item/Item;<init>(Lnet/minecraft/item/Item$Settings;)V
intermediary <init>
Lnet/minecraft/class_1792;<init>(Lnet/minecraft/class_1792$class_1793;)V
official <init>
Lcul;<init>(Lcul$a;)V
-
-
Method Details
-
isNetworkSynced
public boolean isNetworkSynced()Returns whether the item needs to sync additional data to clients.Items should ideally store all necessary information in the stack's components. However, this is not always possible for things like maps. In those cases, items can send a packet to the player holding it that syncs additional data. Such items must subclass
NetworkSyncedItem
.- Overrides:
isNetworkSynced
in classItem
- Returns:
- whether the item needs to sync additional data to clients
- See Also:
- Mappings:
Namespace Name Mixin selector named isNetworkSynced
Lnet/minecraft/item/Item;isNetworkSynced()Z
intermediary method_16698
Lnet/minecraft/class_1792;method_16698()Z
official ao_
Lcul;ao_()Z
-
createSyncPacket
@Nullable public @Nullable Packet<?> createSyncPacket(ItemStack stack, World world, PlayerEntity player) Creates a packet that syncs additional item data to the client.- Mappings:
Namespace Name Mixin selector named createSyncPacket
Lnet/minecraft/item/NetworkSyncedItem;createSyncPacket(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/network/packet/Packet;
intermediary method_7757
Lnet/minecraft/class_1762;method_7757(Lnet/minecraft/class_1799;Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;)Lnet/minecraft/class_2596;
official a
Lcsz;a(Lcuq;Ldcw;Lcmx;)Lzg;
-