Package net.minecraft.item
Class SpawnEggItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.SpawnEggItem
- All Implemented Interfaces:
ItemConvertible
public class SpawnEggItem extends Item
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description private intprimaryColorprivate intsecondaryColorprivate static Map<EntityType<?>,SpawnEggItem>SPAWN_EGGSprivate EntityType<?>typeFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM -
Constructor Summary
Constructors Constructor Description SpawnEggItem(EntityType<?> type, int primaryColor, int secondaryColor, Item.Settings settings) -
Method Summary
Modifier and Type Method Description static SpawnEggItemforEntity(EntityType<?> type)static Iterable<SpawnEggItem>getAll()intgetColor(int num)EntityType<?>getEntityType(CompoundTag tag)booleanisOfSameEntityType(CompoundTag tag, EntityType<?> type)Optional<MobEntity>spawnBaby(PlayerEntity user, MobEntity mobEntity, EntityType<? extends MobEntity> entityType, World world, Vec3d vec3d, ItemStack itemStack)TypedActionResult<ItemStack>use(World world, PlayerEntity user, Hand hand)ActionResultuseOnBlock(ItemUsageContext context)Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getStackForRender, getTranslationKey, getTranslationKey, getUseAction, hasEnchantmentGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postHit, postMine, postProcessTag, rayTrace, shouldSyncTagToClient, toString, usageTick, useOnEntity
-
Field Details
-
SPAWN_EGGS
-
primaryColor
private final int primaryColor -
secondaryColor
private final int secondaryColor -
type
-
-
Constructor Details
-
SpawnEggItem
public SpawnEggItem(EntityType<?> type, int primaryColor, int secondaryColor, Item.Settings settings)
-
-
Method Details
-
useOnBlock
- Overrides:
useOnBlockin classItem
-
use
-
isOfSameEntityType
-
getColor
@Environment(CLIENT) public int getColor(int num) -
forEntity
-
getAll
-
getEntityType
-
spawnBaby
public Optional<MobEntity> spawnBaby(PlayerEntity user, MobEntity mobEntity, EntityType<? extends MobEntity> entityType, World world, Vec3d vec3d, ItemStack itemStack)
-