Package com.minecolonies.api.entity.mobs
Class RaiderMobUtils
java.lang.Object
com.minecolonies.api.entity.mobs.RaiderMobUtils
Util class for raider mobs/spawning
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.neoforged.neoforge.registries.DeferredRegister<net.minecraft.world.entity.ai.attributes.Attribute> static intDamage increased by 1 for every 200 raid level difficultystatic intMax damage from raidlevelsstatic final net.neoforged.neoforge.registries.DeferredHolder<net.minecraft.world.entity.ai.attributes.Attribute, net.minecraft.world.entity.ai.attributes.RangedAttribute> Mob attribute, used for custom attack damage -
Method Summary
Modifier and TypeMethodDescriptionstatic List<AbstractEntityMinecoloniesRaider> getBarbariansCloseToEntity(net.minecraft.world.entity.Entity entity, double distanceFromEntity) Returns the barbarians close to an entity.static doublegetHealthBasedOnRaidLevel(int raidLevel) Sets the entity's health based on the raidLevelstatic voidSet the equipment of a certain mob.static voidsetMobAttributes(AbstractEntityMinecoloniesRaider mob, IColony colony) Set mob attributes.static voidspawn(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
-
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_DAMAGEMob attribute, used for custom attack damage -
DAMAGE_PER_X_RAID_LEVEL
public static int DAMAGE_PER_X_RAID_LEVELDamage increased by 1 for every 200 raid level difficulty -
MAX_RAID_LEVEL_DAMAGE
public static int MAX_RAID_LEVEL_DAMAGEMax damage from raidlevels
-
-
Method Details
-
setMobAttributes
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 spawnednumberOfSpawns- The number of times the entity should be spawnedspawnLocation- the location at which to spawn the entityworld- the world in which the colony and entity arecolony- the colony to spawn them close to.eventID- the event id.
-
setEquipment
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 againstdistanceFromEntity- The distance to check for- Returns:
- the barbarians (if any) that is nearest
-