Interface EntityCanAttack

All Known Implementing Classes:
EntityAmphibiousMob, EntityBlaze, EntityCaveSpider, EntityCreeper, EntityDrowned, EntityElderGuardian, EntityEnderDragon, EntityEnderman, EntityEndermite, EntityEvoker, EntityFlyingMob, EntityGhast, EntityGuardian, EntityHoglin, EntityHusk, EntityIronGolem, EntityMagmaCube, EntityMob, EntityPhantom, EntityPiglin, EntityPiglinBrute, EntityPillager, EntityRavager, EntityShulker, EntitySilverfish, EntitySkeleton, EntitySlime, EntitySnowGolem, EntitySpider, EntityStray, EntitySwimmingMob, EntityVex, EntityVindicator, EntityWalkingMob, EntityWarden, EntityWitch, EntityWither, EntityWitherSkeleton, EntityWolf, EntityZoglin, EntityZombie, EntityZombiePigman, EntityZombieVillager, EntityZombieVillagerV1

@PowerNukkitXOnly @Since("1.19.30-r1") public interface EntityCanAttack
代表可以攻击其他实体的实体.

Represents an entity that can attack other entities.

  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    得到所有难度下不携带物品能造成的伤害.
    float
    getDiffHandDamage(int difficulty)
    得到指定难度下不携带物品能造成的伤害.
    void
    setDiffHandDamage(float[] damages)
    设置所有难度下不携带物品能造成的伤害.
    void
    setDiffHandDamage(int difficulty, float damage)
    设置指定难度下不携带物品能造成的伤害
  • Method Details

    • getDiffHandDamage

      float[] getDiffHandDamage()
      得到所有难度下不携带物品能造成的伤害.

      Get the damage you can do without carrying items on all difficulties.

      Returns:
      一个包含所有难度下伤害的数组, 0 1 2分别代表简单、普通、困难难度
      An array containing damage on all difficulties, 0 1 2 for easy, normal and hard difficulties respectively
    • getDiffHandDamage

      float getDiffHandDamage(int difficulty)
      得到指定难度下不携带物品能造成的伤害.

      Get the damage that can be dealt without carrying the item at the specified difficulty.

      Parameters:
      difficulty - 难度id
      difficulty id
      Returns:
      伤害
      damage
    • setDiffHandDamage

      void setDiffHandDamage(float[] damages)
      设置所有难度下不携带物品能造成的伤害.

      Set the damage that can be dealt without carrying items on all difficulties.

      Parameters:
      damages - 伤害
    • setDiffHandDamage

      void setDiffHandDamage(int difficulty, float damage)
      设置指定难度下不携带物品能造成的伤害

      Set the damage that can be dealt without carrying the item at the specified difficulty.

      Parameters:
      difficulty - 难度
      damage - 伤害