Class EatBlockGoal

java.lang.Object
net.minestom.server.entity.ai.GoalSelector
net.minestom.server.entity.ai.goal.EatBlockGoal

public class EatBlockGoal
extends GoalSelector
  • Field Summary

    Fields inherited from class net.minestom.server.entity.ai.GoalSelector

    entityCreature
  • Constructor Summary

    Constructors 
    Constructor Description
    EatBlockGoal​(EntityCreature entityCreature, java.util.Map<java.lang.Short,​java.lang.Short> eatInMap, java.util.Map<java.lang.Short,​java.lang.Short> eatBelowMap, int chancePerTick)  
  • Method Summary

    Modifier and Type Method Description
    void end()
    Ends this GoalSelector.
    boolean shouldEnd()
    Whether or not this GoalSelector should end.
    boolean shouldStart()
    Whether or not this GoalSelector should start.
    void start()
    Starts this GoalSelector.
    void tick​(long time)
    Called every tick when this GoalSelector is running

    Methods inherited from class net.minestom.server.entity.ai.GoalSelector

    findTarget

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EatBlockGoal

      public EatBlockGoal​(@NotNull EntityCreature entityCreature, @NotNull java.util.Map<java.lang.Short,​java.lang.Short> eatInMap, @NotNull java.util.Map<java.lang.Short,​java.lang.Short> eatBelowMap, int chancePerTick)
      Parameters:
      entityCreature - Creature that should eat a block.
      eatInMap - Map containing the block IDs that the entity can eat (when inside the block) and the block ID of the replacement block.
      eatBelowMap - Map containing block IDs that the entity can eat (when above the block) and the block ID of the replacement block.
      chancePerTick - The chance (per tick) that the entity eats. Settings this to N would mean there is a 1 in N chance.
  • Method Details