All Implemented Interfaces:
ITickingStateAI

public class EntityAIWorkBeekeeper extends AbstractEntityAIInteract<JobBeekeeper,BuildingBeekeeper>
Beekeeper AI class.
  • Constructor Details

    • EntityAIWorkBeekeeper

      public EntityAIWorkBeekeeper(@NotNull @NotNull JobBeekeeper job)
      Creates the abstract part of the AI. Always use this constructor!
      Parameters:
      job - the job to fulfill
  • Method Details

    • getActionsDoneUntilDumping

      protected int getActionsDoneUntilDumping()
      Description copied from class: AbstractEntityAIBasic
      Calculates after how many actions the ai should dump it's inventory.

      Override this to change the value.

      Overrides:
      getActionsDoneUntilDumping in class AbstractEntityAIBasic<JobBeekeeper,BuildingBeekeeper>
      Returns:
      the number of actions done before item dump.
    • walkingToAnimal

      public boolean walkingToAnimal(net.minecraft.world.entity.animal.Animal animal)
      Lets the herder walk to the animal.
      Parameters:
      animal - the animal to walk to.
      Returns:
      false if the herder is walking to the animal.
    • equipTool

      public boolean equipTool(net.minecraft.world.InteractionHand hand, EquipmentTypeEntry toolType)
      Sets the tool as held item.
      Parameters:
      toolType - the EquipmentTypeEntry we want to equip
      hand - the hand to equip it in.
      Returns:
      true if the tool was equipped.
    • equipItem

      public boolean equipItem(net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack itemStack)
      Sets the ItemStack as held item or returns false.
      Parameters:
      itemStack - the ItemStack to equip.
      hand - the hand to equip it in.
      Returns:
      true if the item was equipped.
    • equipBreedItem

      public boolean equipBreedItem(net.minecraft.world.InteractionHand hand)
      Sets the ItemStack as held item or returns false.
      Parameters:
      hand - the hand to equip it in.
      Returns:
      true if the item was equipped.
    • getItemSlot

      public int getItemSlot(net.minecraft.world.item.Item item)
      Gets the slot in which the inserted item is in. (if any).
      Parameters:
      item - The Item to check for.
      Returns:
      slot number -1 if not in INV.
    • searchForAnimals

      public static List<net.minecraft.world.entity.animal.Bee> searchForAnimals(net.minecraft.world.level.Level world, BuildingBeekeeper ownBuilding)
      Find animals in area.
      Returns:
      the List of animals in the area.
    • getExpectedBuildingClass

      public Class<BuildingBeekeeper> getExpectedBuildingClass()
      Can be overridden in implementations to return the exact building type the worker expects.
      Specified by:
      getExpectedBuildingClass in class AbstractEntityAIBasic<JobBeekeeper,BuildingBeekeeper>
      Returns:
      the building type associated with this AI's worker.