Class SnowGolem

All Implemented Interfaces:
CommandSource, Attackable, RangedAttackMob, Shearable, Targeting, EntityAccess, Nameable, ScoreHolder, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeEntity, IForgeLivingEntity, IForgeShearable, INBTSerializable<CompoundTag>

public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackMob, IForgeShearable
  • Field Details

  • Constructor Details

  • Method Details

    • registerGoals

      protected void registerGoals()
      Overrides:
      registerGoals in class Mob
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • defineSynchedData

      protected void defineSynchedData()
      Overrides:
      defineSynchedData in class Mob
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag p_29923_)
      Overrides:
      addAdditionalSaveData in class Mob
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag p_29915_)
      Overrides:
      readAdditionalSaveData in class Mob
    • isSensitiveToWater

      public boolean isSensitiveToWater()
      Overrides:
      isSensitiveToWater in class LivingEntity
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class Mob
    • performRangedAttack

      public void performRangedAttack(LivingEntity p_29912_, float p_29913_)
      Specified by:
      performRangedAttack in interface RangedAttackMob
    • getStandingEyeHeight

      protected float getStandingEyeHeight(Pose p_29917_, EntityDimensions p_29918_)
      Overrides:
      getStandingEyeHeight in class LivingEntity
    • mobInteract

      protected InteractionResult mobInteract(Player p_29920_, InteractionHand p_29921_)
      Overrides:
      mobInteract in class Mob
    • shear

      public void shear(SoundSource p_29907_)
      Specified by:
      shear in interface Shearable
    • readyForShearing

      public boolean readyForShearing()
      Specified by:
      readyForShearing in interface Shearable
    • hasPumpkin

      public boolean hasPumpkin()
    • setPumpkin

      public void setPumpkin(boolean p_29937_)
    • getAmbientSound

      @Nullable protected SoundEvent getAmbientSound()
      Overrides:
      getAmbientSound in class AbstractGolem
    • getHurtSound

      @Nullable protected SoundEvent getHurtSound(DamageSource p_29929_)
      Overrides:
      getHurtSound in class AbstractGolem
    • getDeathSound

      @Nullable protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class AbstractGolem
    • getLeashOffset

      public Vec3 getLeashOffset()
      Overrides:
      getLeashOffset in class Entity
    • isShearable

      public boolean isShearable(@NotNull @NotNull ItemStack item, Level world, BlockPos pos)
      Description copied from interface: IForgeShearable
      Checks if the object is currently shearable Example: Sheep return false when they have no wool
      Specified by:
      isShearable in interface IForgeShearable
      Parameters:
      item - The ItemStack that is being used, may be empty.
      world - The current level.
      pos - Block's position in level.
      Returns:
      If this is shearable, and onSheared should be called.
    • onSheared

      @NotNull public List<ItemStack> onSheared(@Nullable Player player, @NotNull @NotNull ItemStack item, Level world, BlockPos pos, int fortune)
      Description copied from interface: IForgeShearable
      Performs the shear function on this object. This is called for both client, and server. The object should perform all actions related to being sheared, except for dropping of the items, and removal of the block. As those are handled by ItemShears itself. Returns a list of items that resulted from the shearing process. For entities, they should trust there internal location information over the values passed into this function.
      Specified by:
      onSheared in interface IForgeShearable
      item - The ItemStack that is being used, may be empty.
      world - The current level.
      pos - If this is a block, the block's position in level.
      fortune - The fortune level of the shears being used.
      Returns:
      A List containing all items from this shearing. May be empty.