Class ExpandMob
java.lang.Object
com.blamejared.crafttweaker.natives.entity.type.misc.ExpandMob
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidate(net.minecraft.world.entity.Mob internal) Triggers the eat event for this mob.static booleancanBeLeashed(net.minecraft.world.entity.Mob internal) Checks if the mob can be leashed.static booleancanFireProjectileWeapon(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ProjectileWeaponItem weapon) Checks if the mob can fire a projectile weapon.static booleancanHoldItem(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack stack) Checks if the mob can hold the given item.static booleancanPickUpLoot(net.minecraft.world.entity.Mob internal) Checks if the mob can pick up loot.static booleancanReplaceEqualItem(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack toReplace, net.minecraft.world.item.ItemStack with) Checks if the mob can replace an item with another item.static booleancheckSpawnObstruction(net.minecraft.world.entity.Mob internal, net.minecraft.world.level.LevelReader level) Checks if the mob can spawn in the givenlevel.static booleancheckSpawnRules(net.minecraft.world.entity.Mob internal, net.minecraft.world.level.LevelAccessor level, net.minecraft.world.entity.MobSpawnType spawnType) Checks if the mob can spawn in the givenlevelwith the givenMobSpawnType.static voidclearRestriction(net.minecraft.world.entity.Mob internal) Clears the restriction for the mob.static voiddropLeash(net.minecraft.world.entity.Mob internal, boolean broadcastPacket, boolean dropLeash) Drops the leash for the mob.static net.minecraft.world.item.ItemStackequipItemIfPossible(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack stack) Equips the mob with the given item if possible.static intgetAmbientSoundInterval(net.minecraft.world.entity.Mob internal) Gets the interval of the ambient sound for this mob.static intgetHeadRotSpeed(net.minecraft.world.entity.Mob internal) Gets the maximum head rotation speed.static net.minecraft.world.entity.EntitygetLeashHolder(net.minecraft.world.entity.Mob internal) Gets the entity that the mob is leashed to.static intgetMaxHeadXRot(net.minecraft.world.entity.Mob internal) Gets the maximum head rotation in the X direction.static intgetMaxHeadYRot(net.minecraft.world.entity.Mob internal) Gets the maximum head rotation in the Y direction.static intgetMaxSpawnClusterSize(net.minecraft.world.entity.Mob internal) Gets the maximum spawn cluster size.static net.minecraft.core.BlockPosgetRestrictCenter(net.minecraft.world.entity.Mob internal) Gets the position that the mob is restricted to.static floatgetRestrictRadius(net.minecraft.world.entity.Mob internal) Gets the radius that the mob is restricted to.static booleanhasRestriction(net.minecraft.world.entity.Mob internal) Checks if the mob has a restriction.static booleanisAggressive(net.minecraft.world.entity.Mob internal) Checks if the mob is aggressive.static booleanisLeashed(net.minecraft.world.entity.Mob internal) Checks if the mob is leashed.static booleanisLeftHanded(net.minecraft.world.entity.Mob internal) Checks if the mob is left-handed.static booleanisMaxGroupSizeReached(net.minecraft.world.entity.Mob internal, int size) Checks if the mob's maximum group size is reached.static booleanisNoAi(net.minecraft.world.entity.Mob internal) Checks if the mob has AI disabled.static booleanisPersistenceRequired(net.minecraft.world.entity.Mob internal) Checks if the mob should persist in the world.static booleanisWithinMeleeAttackRange(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.LivingEntity entity) Checks if the mob is within melee attack range of the givenLivingEntity.static booleanisWithinRestriction(net.minecraft.world.entity.Mob internal) Checks if the mob is within a restriction.static booleanisWithinRestriction(net.minecraft.world.entity.Mob internal, net.minecraft.core.BlockPos position) Checks if the mob is within a restriction.static voidlookAt(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.Entity entity, float maxXRotIncrease, float maxYRotIncrease) Makes the mob look at the given entity.static voidplayAmbientSound(net.minecraft.world.entity.Mob internal) Plays the ambient sound for this mob.static voidrestrictTo(net.minecraft.world.entity.Mob internal, net.minecraft.core.BlockPos restrictCenter, int restrictRadius) Restricts the mob to the given position and radius.static voidsetAggressive(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should be aggressive.static voidsetBaby(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should be a baby.static voidsetCanPickUpLoot(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob can pick up loot.static voidsetDropChance(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.EquipmentSlot slot, float chance) Sets the drop chance for the givenEquipmentSlot.static voidsetGuaranteedDrop(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.EquipmentSlot slot) Sets that the item in the givenEquipmentSlotshould always drop when it is killed.static voidsetLeashedTo(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.Entity leashHolder, boolean broadcastPacket) Sets the entity that the mob is leashed to.static voidsetLeftHanded(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should be left-handed.static voidsetNoAi(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should have AI disabled.static voidsetPersistenceRequired(net.minecraft.world.entity.Mob internal) Sets that this mob should persist in the world.static voidsetTarget(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.LivingEntity target) Sets the target of the mob.static booleanwantsToPickUp(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack stack) Checks if the mob wants to pick up the given item.
-
Constructor Details
-
ExpandMob
public ExpandMob()
-
-
Method Details
-
setTarget
public static void setTarget(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.LivingEntity target) Sets the target of the mob.- Parameters:
target- The target of the mob.
-
canFireProjectileWeapon
public static boolean canFireProjectileWeapon(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ProjectileWeaponItem weapon) Checks if the mob can fire a projectile weapon.- Parameters:
weapon- The weapon to check.- Returns:
- Whether the mob can fire the weapon.
-
ate
public static void ate(net.minecraft.world.entity.Mob internal) Triggers the eat event for this mob. This is used by sheep when they eat grass to regrow their wool / grow up. -
getAmbientSoundInterval
public static int getAmbientSoundInterval(net.minecraft.world.entity.Mob internal) Gets the interval of the ambient sound for this mob.- Returns:
- The interval of the ambient sound for this mob.
-
playAmbientSound
public static void playAmbientSound(net.minecraft.world.entity.Mob internal) Plays the ambient sound for this mob. -
equipItemIfPossible
public static net.minecraft.world.item.ItemStack equipItemIfPossible(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack stack) Equips the mob with the given item if possible.- Parameters:
stack- The item to equip.- Returns:
- The item that was equipped.
-
setGuaranteedDrop
public static void setGuaranteedDrop(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.EquipmentSlot slot) Sets that the item in the givenEquipmentSlotshould always drop when it is killed.- Parameters:
slot- The equipment slot to set the guaranteed drop rate for.
-
canReplaceEqualItem
public static boolean canReplaceEqualItem(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack toReplace, net.minecraft.world.item.ItemStack with) Checks if the mob can replace an item with another item.- Parameters:
toReplace- The item to replace.with- The item to replace with.- Returns:
- Whether the mob can replace the item.
-
canHoldItem
public static boolean canHoldItem(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack stack) Checks if the mob can hold the given item.- Parameters:
stack- The item to check.- Returns:
- Whether the mob can hold the item.
-
wantsToPickUp
public static boolean wantsToPickUp(net.minecraft.world.entity.Mob internal, net.minecraft.world.item.ItemStack stack) Checks if the mob wants to pick up the given item.- Parameters:
stack- The item to check.- Returns:
- Whether the mob wants to pick up the item.
-
getMaxHeadXRot
public static int getMaxHeadXRot(net.minecraft.world.entity.Mob internal) Gets the maximum head rotation in the X direction.- Returns:
- The maximum head rotation in the X direction.
-
getMaxHeadYRot
public static int getMaxHeadYRot(net.minecraft.world.entity.Mob internal) Gets the maximum head rotation in the Y direction.- Returns:
- The maximum head rotation in the Y direction.
-
getHeadRotSpeed
public static int getHeadRotSpeed(net.minecraft.world.entity.Mob internal) Gets the maximum head rotation speed.- Returns:
- The maximum head rotation speed.
-
lookAt
public static void lookAt(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.Entity entity, float maxXRotIncrease, float maxYRotIncrease) Makes the mob look at the given entity.- Parameters:
entity- The entity to look at.maxXRotIncrease- The maximum rotation in the X direction.maxYRotIncrease- The maximum rotation in the Y direction.
-
checkSpawnRules
public static boolean checkSpawnRules(net.minecraft.world.entity.Mob internal, net.minecraft.world.level.LevelAccessor level, net.minecraft.world.entity.MobSpawnType spawnType) Checks if the mob can spawn in the givenlevelwith the givenMobSpawnType.- Parameters:
level- The level to check.spawnType- The type of spawn.- Returns:
- Whether the mob can spawn in the given level.
-
checkSpawnObstruction
public static boolean checkSpawnObstruction(net.minecraft.world.entity.Mob internal, net.minecraft.world.level.LevelReader level) Checks if the mob can spawn in the givenlevel.- Parameters:
level- The level to check.- Returns:
- Whether the mob can spawn in the given level.
-
getMaxSpawnClusterSize
public static int getMaxSpawnClusterSize(net.minecraft.world.entity.Mob internal) Gets the maximum spawn cluster size.- Returns:
- The maximum spawn cluster size.
-
isMaxGroupSizeReached
public static boolean isMaxGroupSizeReached(net.minecraft.world.entity.Mob internal, int size) Checks if the mob's maximum group size is reached. This is mainly used by fish when they are spawned naturally.- Parameters:
size- The size to check.- Returns:
- Whether the mob's maximum group size is reached.
-
setPersistenceRequired
public static void setPersistenceRequired(net.minecraft.world.entity.Mob internal) Sets that this mob should persist in the world. -
setDropChance
public static void setDropChance(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.EquipmentSlot slot, float chance) Sets the drop chance for the givenEquipmentSlot.- Parameters:
slot- The equipment slot to set the drop chance for.chance- The chance to drop the item.
-
canPickUpLoot
public static boolean canPickUpLoot(net.minecraft.world.entity.Mob internal) Checks if the mob can pick up loot.- Returns:
- Whether the mob can pick up loot.
-
setCanPickUpLoot
public static void setCanPickUpLoot(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob can pick up loot.- Parameters:
value- Whether the mob can pick up loot.
-
isPersistenceRequired
public static boolean isPersistenceRequired(net.minecraft.world.entity.Mob internal) Checks if the mob should persist in the world.- Returns:
- Whether the mob should persist in the world.
-
isWithinRestriction
public static boolean isWithinRestriction(net.minecraft.world.entity.Mob internal) Checks if the mob is within a restriction.- Returns:
- Whether the mob is within a restriction.
-
isWithinRestriction
public static boolean isWithinRestriction(net.minecraft.world.entity.Mob internal, net.minecraft.core.BlockPos position) Checks if the mob is within a restriction.- Parameters:
position- The position to check.- Returns:
- Whether the mob is within a restriction.
-
restrictTo
public static void restrictTo(net.minecraft.world.entity.Mob internal, net.minecraft.core.BlockPos restrictCenter, int restrictRadius) Restricts the mob to the given position and radius.- Parameters:
restrictCenter- The position to restrict the mob to.restrictRadius- The radius to restrict the mob to.
-
getRestrictCenter
public static net.minecraft.core.BlockPos getRestrictCenter(net.minecraft.world.entity.Mob internal) Gets the position that the mob is restricted to.- Returns:
- The position that the mob is restricted to.
-
getRestrictRadius
public static float getRestrictRadius(net.minecraft.world.entity.Mob internal) Gets the radius that the mob is restricted to.- Returns:
- The radius that the mob is restricted to.
-
clearRestriction
public static void clearRestriction(net.minecraft.world.entity.Mob internal) Clears the restriction for the mob. -
hasRestriction
public static boolean hasRestriction(net.minecraft.world.entity.Mob internal) Checks if the mob has a restriction.- Returns:
- Whether the mob has a restriction.
-
dropLeash
public static void dropLeash(net.minecraft.world.entity.Mob internal, boolean broadcastPacket, boolean dropLeash) Drops the leash for the mob.- Parameters:
broadcastPacket- Whether to broadcast a packet to the client.dropLeash- Whether to drop the leash item.
-
canBeLeashed
public static boolean canBeLeashed(net.minecraft.world.entity.Mob internal) Checks if the mob can be leashed.- Returns:
- Whether the mob can be leashed.
-
isLeashed
public static boolean isLeashed(net.minecraft.world.entity.Mob internal) Checks if the mob is leashed.- Returns:
- Whether the mob is leashed.
-
getLeashHolder
public static net.minecraft.world.entity.Entity getLeashHolder(net.minecraft.world.entity.Mob internal) Gets the entity that the mob is leashed to.- Returns:
- The entity that the mob is leashed to.
-
setLeashedTo
public static void setLeashedTo(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.Entity leashHolder, boolean broadcastPacket) Sets the entity that the mob is leashed to.- Parameters:
leashHolder- The entity that the mob is leashed to.broadcastPacket- Whether to broadcast a packet to the client.
-
setNoAi
public static void setNoAi(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should have AI disabled.- Parameters:
value- Whether the mob should have AI disabled.
-
setLeftHanded
public static void setLeftHanded(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should be left-handed.- Parameters:
value- Whether the mob should be left-handed.
-
setAggressive
public static void setAggressive(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should be aggressive.- Parameters:
value- Whether the mob should be aggressive.
-
isNoAi
public static boolean isNoAi(net.minecraft.world.entity.Mob internal) Checks if the mob has AI disabled.- Returns:
- Whether the mob has AI disabled.
-
isLeftHanded
public static boolean isLeftHanded(net.minecraft.world.entity.Mob internal) Checks if the mob is left-handed.- Returns:
- Whether the mob is left-handed.
-
isAggressive
public static boolean isAggressive(net.minecraft.world.entity.Mob internal) Checks if the mob is aggressive.- Returns:
- Whether the mob is aggressive.
-
setBaby
public static void setBaby(net.minecraft.world.entity.Mob internal, boolean value) Sets whether the mob should be a baby.- Parameters:
value- Whether the mob should be a baby.
-
isWithinMeleeAttackRange
public static boolean isWithinMeleeAttackRange(net.minecraft.world.entity.Mob internal, net.minecraft.world.entity.LivingEntity entity) Checks if the mob is within melee attack range of the givenLivingEntity.- Parameters:
entity- The entity to check.- Returns:
- Whether the mob is within melee attack range of the given entity.
-