Package net.minecraft.item
Class SpawnEggItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.SpawnEggItem
- All Implemented Interfaces:
ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name named net/minecraft/item/SpawnEggItemintermediary net/minecraft/class_1826official dbr
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings, Item.TooltipContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<EntityType<? extends MobEntity>, SpawnEggItem> private final EntityType<?> Fields inherited from class net.minecraft.item.Item
BASE_ATTACK_DAMAGE_MODIFIER_ID, BASE_ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_BLOCKS_ATTACKS_MAX_USE_TIME, DEFAULT_MAX_COUNT, ENTRY_CODEC, ENTRY_PACKET_CODEC, ITEM_BAR_STEPS, MAX_MAX_COUNT, translationKeyFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable SpawnEggItemforEntity(@Nullable EntityType<?> type) static Iterable<SpawnEggItem> getAll()EntityType<?> getEntityType(RegistryWrapper.WrapperLookup registries, ItemStack stack) booleanisOfSameEntityType(RegistryWrapper.WrapperLookup registries, ItemStack stack, EntityType<?> type) booleanshouldShowOperatorBlockWarnings(ItemStack stack, @Nullable PlayerEntity player) spawnBaby(PlayerEntity user, MobEntity entity, EntityType<? extends MobEntity> entityType, ServerWorld world, Vec3d pos, ItemStack stack) use(World world, PlayerEntity user, Hand hand) Called when the player uses (or starts using) the item.useOnBlock(ItemUsageContext context) Called when an item is used on a block.Methods inherited from class net.minecraft.item.Item
appendTooltip, asItem, byRawId, canBeNested, canMine, finishUsing, fromBlock, getBonusAttackDamage, getComponents, getDamageSource, getDefaultStack, getItemBarColor, getItemBarStep, getMaxCount, getMaxUseTime, getMiningSpeed, getName, getName, getRawId, getRecipeRemainder, getRegistryEntry, getTooltipData, getTranslationKey, getUseAction, hasGlint, inventoryTick, isCorrectForDrops, isItemBarVisible, isUsedOnRelease, onClicked, onCraft, onCraftByPlayer, onItemEntityDestroyed, onStackClicked, onStoppedUsing, postDamageEntity, postHit, postMine, postProcessComponents, raycast, toString, usageTick, useOnEntityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Field Details
-
SPAWN_EGGS
- Mappings:
Namespace Name Mixin selector named SPAWN_EGGSLnet/minecraft/item/SpawnEggItem;SPAWN_EGGS:Ljava/util/Map;intermediary field_8914Lnet/minecraft/class_1826;field_8914:Ljava/util/Map;official aLdbr;a:Ljava/util/Map;
-
type
- Mappings:
Namespace Name Mixin selector named typeLnet/minecraft/item/SpawnEggItem;type:Lnet/minecraft/entity/EntityType;intermediary field_8917Lnet/minecraft/class_1826;field_8917:Lnet/minecraft/class_1299;official bLdbr;b:Lbxn;
-
-
Constructor Details
-
SpawnEggItem
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/item/SpawnEggItem;<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/item/Item$Settings;)Vintermediary <init>Lnet/minecraft/class_1826;<init>(Lnet/minecraft/class_1299;Lnet/minecraft/class_1792$class_1793;)Vofficial <init>Ldbr;<init>(Lbxn;Ldag$a;)V
-
-
Method Details
-
useOnBlock
Called when an item is used on a block.This method is called on both the logical client and logical server, so take caution when using this method. The logical side can be checked using
context.getWorld().isClient().- Overrides:
useOnBlockin classItem- Parameters:
context- the usage context- Returns:
- an action result that specifies if using the item on a block was successful.
- Mappings:
Namespace Name Mixin selector named useOnBlockLnet/minecraft/item/Item;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;intermediary method_7884Lnet/minecraft/class_1792;method_7884(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;official aLdag;a(Ldef;)Lbvc;
-
use
Called when the player uses (or starts using) the item. The use action, by default, is bound to the right mouse button. This method checks the player's hunger when the item is a food, and will pass in all other cases by default.If the item can be used for multiple ticks, then this will only be called when the player starts using it. After that,
Item.usageTick(net.minecraft.world.World, net.minecraft.entity.LivingEntity, net.minecraft.item.ItemStack, int)is called every tick until the player finishes using the item.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient().- Overrides:
usein classItem- Parameters:
world- the world the item was used inuser- the player who used the itemhand- the hand used- Returns:
- a typed action result that specifies whether using the item was successful. The action result contains the new item stack that the player's hand will be set to.
- Mappings:
Namespace Name Mixin selector named useLnet/minecraft/item/Item;use(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;intermediary method_7836Lnet/minecraft/class_1792;method_7836(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1269;official aLdag;a(Ldkj;Lcsi;Lbvb;)Lbvc;
-
isOfSameEntityType
public boolean isOfSameEntityType(RegistryWrapper.WrapperLookup registries, ItemStack stack, EntityType<?> type) - Mappings:
Namespace Name Mixin selector named isOfSameEntityTypeLnet/minecraft/item/SpawnEggItem;isOfSameEntityType(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EntityType;)Zintermediary method_8018Lnet/minecraft/class_1826;method_8018(Lnet/minecraft/class_7225$class_7874;Lnet/minecraft/class_1799;Lnet/minecraft/class_1299;)Zofficial aLdbr;a(Lji$a;Ldak;Lbxn;)Z
-
forEntity
- Mappings:
Namespace Name Mixin selector named forEntityLnet/minecraft/item/SpawnEggItem;forEntity(Lnet/minecraft/entity/EntityType;)Lnet/minecraft/item/SpawnEggItem;intermediary method_8019Lnet/minecraft/class_1826;method_8019(Lnet/minecraft/class_1299;)Lnet/minecraft/class_1826;official aLdbr;a(Lbxn;)Ldbr;
-
getAll
- Mappings:
Namespace Name Mixin selector named getAllLnet/minecraft/item/SpawnEggItem;getAll()Ljava/lang/Iterable;intermediary method_8017Lnet/minecraft/class_1826;method_8017()Ljava/lang/Iterable;official aLdbr;a()Ljava/lang/Iterable;
-
getEntityType
- Mappings:
Namespace Name Mixin selector named getEntityTypeLnet/minecraft/item/SpawnEggItem;getEntityType(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/entity/EntityType;intermediary method_8015Lnet/minecraft/class_1826;method_8015(Lnet/minecraft/class_7225$class_7874;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1299;official aLdbr;a(Lji$a;Ldak;)Lbxn;
-
getRequiredFeatures
- Specified by:
getRequiredFeaturesin interfaceToggleableFeature- Overrides:
getRequiredFeaturesin classItem- Mappings:
Namespace Name Mixin selector named getRequiredFeaturesLnet/minecraft/resource/featuretoggle/ToggleableFeature;getRequiredFeatures()Lnet/minecraft/resource/featuretoggle/FeatureSet;intermediary method_45322Lnet/minecraft/class_7695;method_45322()Lnet/minecraft/class_7699;official kLcvp;k()Lcvs;
-
spawnBaby
public Optional<MobEntity> spawnBaby(PlayerEntity user, MobEntity entity, EntityType<? extends MobEntity> entityType, ServerWorld world, Vec3d pos, ItemStack stack) - Mappings:
Namespace Name Mixin selector named spawnBabyLnet/minecraft/item/SpawnEggItem;spawnBaby(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/mob/MobEntity;Lnet/minecraft/entity/EntityType;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/item/ItemStack;)Ljava/util/Optional;intermediary method_24793Lnet/minecraft/class_1826;method_24793(Lnet/minecraft/class_1657;Lnet/minecraft/class_1308;Lnet/minecraft/class_1299;Lnet/minecraft/class_3218;Lnet/minecraft/class_243;Lnet/minecraft/class_1799;)Ljava/util/Optional;official aLdbr;a(Lcsi;Lbyh;Lbxn;Lasb;Lfgc;Ldak;)Ljava/util/Optional;
-
shouldShowOperatorBlockWarnings
public boolean shouldShowOperatorBlockWarnings(ItemStack stack, @Nullable @Nullable PlayerEntity player) - Overrides:
shouldShowOperatorBlockWarningsin classItem- Mappings:
Namespace Name Mixin selector named shouldShowOperatorBlockWarningsLnet/minecraft/item/Item;shouldShowOperatorBlockWarnings(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_65353Lnet/minecraft/class_1792;method_65353(Lnet/minecraft/class_1799;Lnet/minecraft/class_1657;)Zofficial aLdag;a(Ldak;Lcsi;)Z
-