类 SpawnEggItem
- java.lang.Object
-
- net.minecraft.item.Item
-
- net.minecraft.item.SpawnEggItem
-
- 所有已实现的接口:
ItemConvertible
public class SpawnEggItem extends Item
- Mappings:
Namespace Name official bqsintermediary net/minecraft/class_1826named net/minecraft/item/SpawnEggItem
-
-
嵌套类概要
-
从类继承的嵌套类/接口 net.minecraft.item.Item
Item.Settings
-
-
字段概要
字段 修饰符和类型 字段 说明 private intprimaryColorprivate intsecondaryColorprivate static Map<EntityType<? extends MobEntity>,SpawnEggItem>SPAWN_EGGSprivate EntityType<?>type-
从类继承的字段 net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_MAX_COUNT, field_30888, field_30889, group
-
-
构造器概要
构造器 构造器 说明 SpawnEggItem(EntityType<? extends MobEntity> type, int primaryColor, int secondaryColor, Item.Settings settings)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static @Nullable SpawnEggItemforEntity(@Nullable EntityType<?> type)static Iterable<SpawnEggItem>getAll()intgetColor(int num)EntityType<?>getEntityType(@Nullable CompoundTag nbt)booleanisOfSameEntityType(@Nullable CompoundTag nbt, EntityType<?> type)Optional<MobEntity>spawnBaby(PlayerEntity user, MobEntity entity, EntityType<? extends MobEntity> entityType, ServerWorld world, Vec3d pos, ItemStack stack)TypedActionResult<ItemStack>use(World world, PlayerEntity user, Hand hand)Called when an item is used by a player.ActionResultuseOnBlock(ItemUsageContext context)Called when an item is used on a block.-
从类继承的方法 net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canBeNested, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getEquipSound, getFoodComponent, getGroup, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isItemBarVisible, isNetworkSynced, isSuitableFor, isUsedOnRelease, onClicked, onCraft, onItemEntityDestroyed, onStackClicked, onStoppedUsing, postHit, postMine, postProcessNbt, raycast, shouldSyncTagToClient, toString, usageTick, useOnEntity
-
-
-
-
字段详细资料
-
SPAWN_EGGS
private static final Map<EntityType<? extends MobEntity>,SpawnEggItem> SPAWN_EGGS
- Mappings:
Namespace Name Mixin selector official aLbqs;a:Ljava/util/Map;intermediary field_8914Lnet/minecraft/class_1826;field_8914:Ljava/util/Map;named SPAWN_EGGSLnet/minecraft/item/SpawnEggItem;SPAWN_EGGS:Ljava/util/Map;
-
primaryColor
private final int primaryColor
- Mappings:
Namespace Name Mixin selector official bLbqs;b:Iintermediary field_8916Lnet/minecraft/class_1826;field_8916:Inamed primaryColorLnet/minecraft/item/SpawnEggItem;primaryColor:I
-
secondaryColor
private final int secondaryColor
- Mappings:
Namespace Name Mixin selector official cLbqs;c:Iintermediary field_8915Lnet/minecraft/class_1826;field_8915:Inamed secondaryColorLnet/minecraft/item/SpawnEggItem;secondaryColor:I
-
type
private final EntityType<?> type
- Mappings:
Namespace Name Mixin selector official dLbqs;d:Lasp;intermediary field_8917Lnet/minecraft/class_1826;field_8917:Lnet/minecraft/class_1299;named typeLnet/minecraft/item/SpawnEggItem;type:Lnet/minecraft/entity/EntityType;
-
-
构造器详细资料
-
SpawnEggItem
public SpawnEggItem(EntityType<? extends MobEntity> type, int primaryColor, int secondaryColor, Item.Settings settings)
- Mappings:
Namespace Name Mixin selector official <init>Lbqs;<init>(Lasp;IILbpn$a;)Vintermediary <init>Lnet/minecraft/class_1826;<init>(Lnet/minecraft/class_1299;IILnet/minecraft/class_1792$class_1793;)Vnamed <init>Lnet/minecraft/item/SpawnEggItem;<init>(Lnet/minecraft/entity/EntityType;IILnet/minecraft/item/Item$Settings;)V
-
-
方法详细资料
-
useOnBlock
public ActionResult useOnBlock(ItemUsageContext context)
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().- 覆盖:
useOnBlock在类中Item- 参数:
context- the usage context- 返回:
- an action result that specifies if using the item on a block was successful.
- Mappings:
Namespace Name Mixin selector official aLbpn;a(Lbrt;)Larg;intermediary method_7884Lnet/minecraft/class_1792;method_7884(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;named useOnBlockLnet/minecraft/item/Item;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;
-
use
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand)
Called when an item is used by a player. The use action, by default, is bound to the right mouse button.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().- 覆盖:
use在类中Item- 参数:
world- the world the item was used inuser- the player who used the itemhand- the hand used- 返回:
- 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 official aLbpn;a(Lbvr;Lbjf;Larf;)Larh;intermediary method_7836Lnet/minecraft/class_1792;method_7836(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;)Lnet/minecraft/class_1271;named useLnet/minecraft/item/Item;use(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/TypedActionResult;
-
isOfSameEntityType
public boolean isOfSameEntityType(@Nullable @Nullable CompoundTag nbt, EntityType<?> type)
- Mappings:
Namespace Name Mixin selector official aLbqs;a(Lmv;Lasp;)Zintermediary method_8018Lnet/minecraft/class_1826;method_8018(Lnet/minecraft/class_2487;Lnet/minecraft/class_1299;)Znamed isOfSameEntityTypeLnet/minecraft/item/SpawnEggItem;isOfSameEntityType(Lnet/minecraft/nbt/CompoundTag;Lnet/minecraft/entity/EntityType;)Z
-
getColor
public int getColor(int num)
- Mappings:
Namespace Name Mixin selector official aLbqs;a(I)Iintermediary method_8016Lnet/minecraft/class_1826;method_8016(I)Inamed getColorLnet/minecraft/item/SpawnEggItem;getColor(I)I
-
forEntity
@Nullable public static @Nullable SpawnEggItem forEntity(@Nullable @Nullable EntityType<?> type)
- Mappings:
Namespace Name Mixin selector official aLbqs;a(Lasp;)Lbqs;intermediary method_8019Lnet/minecraft/class_1826;method_8019(Lnet/minecraft/class_1299;)Lnet/minecraft/class_1826;named forEntityLnet/minecraft/item/SpawnEggItem;forEntity(Lnet/minecraft/entity/EntityType;)Lnet/minecraft/item/SpawnEggItem;
-
getAll
public static Iterable<SpawnEggItem> getAll()
- Mappings:
Namespace Name Mixin selector official iLbqs;i()Ljava/lang/Iterable;intermediary method_8017Lnet/minecraft/class_1826;method_8017()Ljava/lang/Iterable;named getAllLnet/minecraft/item/SpawnEggItem;getAll()Ljava/lang/Iterable;
-
getEntityType
public EntityType<?> getEntityType(@Nullable @Nullable CompoundTag nbt)
- Mappings:
Namespace Name Mixin selector official aLbqs;a(Lmv;)Lasp;intermediary method_8015Lnet/minecraft/class_1826;method_8015(Lnet/minecraft/class_2487;)Lnet/minecraft/class_1299;named getEntityTypeLnet/minecraft/item/SpawnEggItem;getEntityType(Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityType;
-
spawnBaby
public Optional<MobEntity> spawnBaby(PlayerEntity user, MobEntity entity, EntityType<? extends MobEntity> entityType, ServerWorld world, Vec3d pos, ItemStack stack)
- Mappings:
Namespace Name Mixin selector official aLbqs;a(Lbjf;Lasz;Lasp;Labj;Ldma;Lbpr;)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;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;
-
-