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 - official - cee- intermediary - net/minecraft/class_1762- named - net/minecraft/item/NetworkSyncedItem
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraft.item.ItemItem.Settings
- 
Field SummaryFields inherited from class net.minecraft.item.ItemATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_MAX_COUNT, DEFAULT_MAX_USE_TIME, ITEM_BAR_STEPSFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeatureFEATURE_ENABLED_REGISTRY_KEYS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreateSyncPacket(ItemStack stack, World world, PlayerEntity player) Creates a packet that syncs additional item data to the client.booleanReturns whether the item needs to sync additional data to clients.Methods inherited from class net.minecraft.item.ItemappendTooltip, asItem, byRawId, canBeNested, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getRegistryEntry, getRequiredFeatures, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isItemBarVisible, isNbtSynced, isSuitableFor, isUsedOnRelease, onClicked, onCraft, onItemEntityDestroyed, onStackClicked, onStoppedUsing, postHit, postMine, postProcessNbt, raycast, toString, usageTick, use, useOnBlock, useOnEntityMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeatureisEnabled
- 
Constructor Details- 
NetworkSyncedItem- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lcfu;<init>(Lcfu$a;)V- intermediary - <init>- Lnet/minecraft/class_1792;<init>(Lnet/minecraft/class_1792$class_1793;)V- named - <init>- Lnet/minecraft/item/Item;<init>(Lnet/minecraft/item/Item$Settings;)V
 
 
- 
- 
Method Details- 
isNetworkSyncedpublic boolean isNetworkSynced()Returns whether the item needs to sync additional data to clients.Items should ideally store all necessary information on the stack's NBT. 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:
- isNetworkSyncedin class- Item
- Returns:
- whether the item needs to sync additional data to clients
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - ad_- Lcfu;ad_()Z- intermediary - method_16698- Lnet/minecraft/class_1792;method_16698()Z- named - isNetworkSynced- Lnet/minecraft/item/Item;isNetworkSynced()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 - official - a- Lcee;a(Lcfz;Lcmm;Lbyo;)Luo;- 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;- 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;
 
 
-