Class RaiderMobUtils

java.lang.Object
com.minecolonies.api.entity.mobs.RaiderMobUtils

public final class RaiderMobUtils extends Object
Util class for raider mobs/spawning
  • Field Details

    • ATTRIBUTES

      public static final net.neoforged.neoforge.registries.DeferredRegister<net.minecraft.world.entity.ai.attributes.Attribute> ATTRIBUTES
    • MOB_ATTACK_DAMAGE

      public static final net.neoforged.neoforge.registries.DeferredHolder<net.minecraft.world.entity.ai.attributes.Attribute,net.minecraft.world.entity.ai.attributes.RangedAttribute> MOB_ATTACK_DAMAGE
      Mob attribute, used for custom attack damage
    • DAMAGE_PER_X_RAID_LEVEL

      public static int DAMAGE_PER_X_RAID_LEVEL
      Damage increased by 1 for every 200 raid level difficulty
    • MAX_RAID_LEVEL_DAMAGE

      public static int MAX_RAID_LEVEL_DAMAGE
      Max damage from raidlevels
  • Method Details

    • setMobAttributes

      public static void setMobAttributes(AbstractEntityMinecoloniesRaider mob, IColony colony)
      Set mob attributes.
      Parameters:
      mob - The mob to set the attributes on.
      colony - The colony that the mob is attacking.
    • getHealthBasedOnRaidLevel

      public static double getHealthBasedOnRaidLevel(int raidLevel)
      Sets the entity's health based on the raidLevel
      Parameters:
      raidLevel - the raid level.
      Returns:
      returns the health in the form of a double
    • spawn

      public static void spawn(net.minecraft.world.entity.EntityType<?> entityToSpawn, int numberOfSpawns, net.minecraft.core.BlockPos spawnLocation, net.minecraft.world.level.Level world, IColony colony, int eventID)
      Sets up and spawns the Barbarian entities of choice
      Parameters:
      entityToSpawn - The entity which should be spawned
      numberOfSpawns - The number of times the entity should be spawned
      spawnLocation - the location at which to spawn the entity
      world - the world in which the colony and entity are
      colony - the colony to spawn them close to.
      eventID - the event id.
    • setEquipment

      public static void setEquipment(AbstractEntityMinecoloniesMonster mob)
      Set the equipment of a certain mob.
      Parameters:
      mob - the equipment to set up.
    • getBarbariansCloseToEntity

      public static List<AbstractEntityMinecoloniesRaider> getBarbariansCloseToEntity(net.minecraft.world.entity.Entity entity, double distanceFromEntity)
      Returns the barbarians close to an entity.
      Parameters:
      entity - The entity to test against
      distanceFromEntity - The distance to check for
      Returns:
      the barbarians (if any) that is nearest