程序包 org.bukkit.scoreboard

# 接口 Criteria

public interface Criteria
Represents a scoreboard criteria, either custom or built-in to the Minecraft server, used to keep track of and manually or automatically change scores on a scoreboard.

While this class outlines constants for standard criteria, see `statistic(Statistic)` (and its overloads) to create instances for statistically-backed criteria.

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `static final Criteria`
  `AIR`
  Mirrors the player's air supply (0 for no air, 300 for maximum air).
  `static final Criteria`
  `ARMOR`
  Mirrors the player's armor points (0 for no armor, 20 for maximum armor).
  `static final Criteria`
  `DEATH_COUNT`
  Increments automatically when a player dies.
  `static final Criteria`
  `DUMMY`
  The dummy criteria.
  `static final Criteria`
  `FOOD`
  Mirrors the player's food points (0 for no food, 20 for maximum food).
  `static final Criteria`
  `HEALTH`
  Mirrors the player's health points (0 for no health, 20 for maximum default health).
  `static final Criteria`
  `KILLED_BY_TEAM_AQUA`
  Increments automatically when a player is killed by a player on the aqua team.
  `static final Criteria`
  `KILLED_BY_TEAM_BLACK`
  Increments automatically when a player is killed by a player on the black team.
  `static final Criteria`
  `KILLED_BY_TEAM_BLUE`
  Increments automatically when a player is killed by a player on the blue team.
  `static final Criteria`
  `KILLED_BY_TEAM_DARK_AQUA`
  Increments automatically when a player is killed by a player on the dark aqua team.
  `static final Criteria`
  `KILLED_BY_TEAM_DARK_BLUE`
  Increments automatically when a player is killed by a player on the dark blue team.
  `static final Criteria`
  `KILLED_BY_TEAM_DARK_GRAY`
  Increments automatically when a player is killed by a player on the dark gray team.
  `static final Criteria`
  `KILLED_BY_TEAM_DARK_GREEN`
  Increments automatically when a player is killed by a player on the dark green team.
  `static final Criteria`
  `KILLED_BY_TEAM_DARK_PURPLE`
  Increments automatically when a player is killed by a player on the dark purple team.
  `static final Criteria`
  `KILLED_BY_TEAM_DARK_RED`
  Increments automatically when a player is killed by a player on the dark red team.
  `static final Criteria`
  `KILLED_BY_TEAM_GOLD`
  Increments automatically when a player is killed by a player on the gold team.
  `static final Criteria`
  `KILLED_BY_TEAM_GRAY`
  Increments automatically when a player is killed by a player on the gray team.
  `static final Criteria`
  `KILLED_BY_TEAM_GREEN`
  Increments automatically when a player is killed by a player on the green team.
  `static final Criteria`
  `KILLED_BY_TEAM_LIGHT_PURPLE`
  Increments automatically when a player is killed by a player on the light purple team.
  `static final Criteria`
  `KILLED_BY_TEAM_RED`
  Increments automatically when a player is killed by a player on the red team.
  `static final Criteria`
  `KILLED_BY_TEAM_WHITE`
  Increments automatically when a player is killed by a player on the white team.
  `static final Criteria`
  `KILLED_BY_TEAM_YELLOW`
  Increments automatically when a player is killed by a player on the yellow team.
  `static final Criteria`
  `LEVEL`
  Mirrors the player's experience level.
  `static final Criteria`
  `PLAYER_KILL_COUNT`
  Increments automatically when a player kills another player.
  `static final Criteria`
  `TEAM_KILL_AQUA`
  Increments automatically when a player kills another player on the aqua team.
  `static final Criteria`
  `TEAM_KILL_BLACK`
  Increments automatically when a player kills another player on the black team.
  `static final Criteria`
  `TEAM_KILL_BLUE`
  Increments automatically when a player kills another player on the blue team.
  `static final Criteria`
  `TEAM_KILL_DARK_AQUA`
  Increments automatically when a player kills another player on the dark aqua team.
  `static final Criteria`
  `TEAM_KILL_DARK_BLUE`
  Increments automatically when a player kills another player on the dark blue team.
  `static final Criteria`
  `TEAM_KILL_DARK_GRAY`
  Increments automatically when a player kills another player on the dark gray team.
  `static final Criteria`
  `TEAM_KILL_DARK_GREEN`
  Increments automatically when a player kills another player on the dark green team.
  `static final Criteria`
  `TEAM_KILL_DARK_PURPLE`
  Increments automatically when a player kills another player on the dark purple team.
  `static final Criteria`
  `TEAM_KILL_DARK_RED`
  Increments automatically when a player kills another player on the dark red team.
  `static final Criteria`
  `TEAM_KILL_GOLD`
  Increments automatically when a player kills another player on the gold team.
  `static final Criteria`
  `TEAM_KILL_GRAY`
  Increments automatically when a player kills another player on the gray team.
  `static final Criteria`
  `TEAM_KILL_GREEN`
  Increments automatically when a player kills another player on the green team.
  `static final Criteria`
  `TEAM_KILL_LIGHT_PURPLE`
  Increments automatically when a player kills another player on the light purple team.
  `static final Criteria`
  `TEAM_KILL_RED`
  Increments automatically when a player kills another player on the red team.
  `static final Criteria`
  `TEAM_KILL_WHITE`
  Increments automatically when a player kills another player on the white team.
  `static final Criteria`
  `TEAM_KILL_YELLOW`
  Increments automatically when a player kills another player on the yellow team.
  `static final Criteria`
  `TOTAL_KILL_COUNT`
  Increments automatically when a player kills another living entity.
  `static final Criteria`
  `TRIGGER`
  The trigger criteria.
  `static final Criteria`
  `XP`
  Mirrors the player's experience points.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `static @NotNull Criteria`
  `create(@NotNull String name)`
  Get (or create) a new `Criteria` by its name.
  `@NotNull RenderType`
  `getDefaultRenderType()`
  Get the `RenderType` used by default for this criteria.
  `@NotNull String`
  `getName()`
  Get the name of this criteria (its unique id).
  `boolean`
  `isReadOnly()`
  Get whether or not this criteria is read only.
  `static @NotNull Criteria`
  `statistic(@NotNull Statistic statistic)`
  Get a `Criteria` for the specified statistic.
  `static @NotNull Criteria`
  `statistic(@NotNull Statistic statistic, @NotNull EntityType entityType)`
  Get a `Criteria` for the specified statistic pertaining to an entity type.
  `static @NotNull Criteria`
  `statistic(@NotNull Statistic statistic, @NotNull Material material)`
  Get a `Criteria` for the specified statistic pertaining to blocks or items.

- ## 字段详细资料

  - ### DUMMY

    static final Criteria DUMMY
    The dummy criteria. Not changed by the server.

  - ### TRIGGER

    static final Criteria TRIGGER
    The trigger criteria. Changed when a player runs the /trigger command for an objective.

  - ### DEATH_COUNT

    static final Criteria DEATH_COUNT
    Increments automatically when a player dies.

  - ### PLAYER_KILL_COUNT

    static final Criteria PLAYER_KILL_COUNT
    Increments automatically when a player kills another player.

  - ### TOTAL_KILL_COUNT

    static final Criteria TOTAL_KILL_COUNT
    Increments automatically when a player kills another living entity.

  - ### HEALTH

    static final Criteria HEALTH
    Mirrors the player's health points (0 for no health, 20 for maximum default health).

  - ### FOOD

    static final Criteria FOOD
    Mirrors the player's food points (0 for no food, 20 for maximum food).

  - ### AIR

    static final Criteria AIR
    Mirrors the player's air supply (0 for no air, 300 for maximum air).

  - ### ARMOR

    static final Criteria ARMOR
    Mirrors the player's armor points (0 for no armor, 20 for maximum armor).

  - ### XP

    static final Criteria XP
    Mirrors the player's experience points.

  - ### LEVEL

    static final Criteria LEVEL
    Mirrors the player's experience level.

  - ### TEAM_KILL_BLACK

    static final Criteria TEAM_KILL_BLACK
    Increments automatically when a player kills another player on the black team.

  - ### TEAM_KILL_DARK_BLUE

    static final Criteria TEAM_KILL_DARK_BLUE
    Increments automatically when a player kills another player on the dark blue team.

  - ### TEAM_KILL_DARK_GREEN

    static final Criteria TEAM_KILL_DARK_GREEN
    Increments automatically when a player kills another player on the dark green team.

  - ### TEAM_KILL_DARK_AQUA

    static final Criteria TEAM_KILL_DARK_AQUA
    Increments automatically when a player kills another player on the dark aqua team.

  - ### TEAM_KILL_DARK_RED

    static final Criteria TEAM_KILL_DARK_RED
    Increments automatically when a player kills another player on the dark red team.

  - ### TEAM_KILL_DARK_PURPLE

    static final Criteria TEAM_KILL_DARK_PURPLE
    Increments automatically when a player kills another player on the dark purple team.

  - ### TEAM_KILL_GOLD

    static final Criteria TEAM_KILL_GOLD
    Increments automatically when a player kills another player on the gold team.

  - ### TEAM_KILL_GRAY

    static final Criteria TEAM_KILL_GRAY
    Increments automatically when a player kills another player on the gray team.

  - ### TEAM_KILL_DARK_GRAY

    static final Criteria TEAM_KILL_DARK_GRAY
    Increments automatically when a player kills another player on the dark gray team.

  - ### TEAM_KILL_BLUE

    static final Criteria TEAM_KILL_BLUE
    Increments automatically when a player kills another player on the blue team.

  - ### TEAM_KILL_GREEN

    static final Criteria TEAM_KILL_GREEN
    Increments automatically when a player kills another player on the green team.

  - ### TEAM_KILL_AQUA

    static final Criteria TEAM_KILL_AQUA
    Increments automatically when a player kills another player on the aqua team.

  - ### TEAM_KILL_RED

    static final Criteria TEAM_KILL_RED
    Increments automatically when a player kills another player on the red team.

  - ### TEAM_KILL_LIGHT_PURPLE

    static final Criteria TEAM_KILL_LIGHT_PURPLE
    Increments automatically when a player kills another player on the light purple team.

  - ### TEAM_KILL_YELLOW

    static final Criteria TEAM_KILL_YELLOW
    Increments automatically when a player kills another player on the yellow team.

  - ### TEAM_KILL_WHITE

    static final Criteria TEAM_KILL_WHITE
    Increments automatically when a player kills another player on the white team.

  - ### KILLED_BY_TEAM_BLACK

    static final Criteria KILLED_BY_TEAM_BLACK
    Increments automatically when a player is killed by a player on the black team.

  - ### KILLED_BY_TEAM_DARK_BLUE

    static final Criteria KILLED_BY_TEAM_DARK_BLUE
    Increments automatically when a player is killed by a player on the dark blue team.

  - ### KILLED_BY_TEAM_DARK_GREEN

    static final Criteria KILLED_BY_TEAM_DARK_GREEN
    Increments automatically when a player is killed by a player on the dark green team.

  - ### KILLED_BY_TEAM_DARK_AQUA

    static final Criteria KILLED_BY_TEAM_DARK_AQUA
    Increments automatically when a player is killed by a player on the dark aqua team.

  - ### KILLED_BY_TEAM_DARK_RED

    static final Criteria KILLED_BY_TEAM_DARK_RED
    Increments automatically when a player is killed by a player on the dark red team.

  - ### KILLED_BY_TEAM_DARK_PURPLE

    static final Criteria KILLED_BY_TEAM_DARK_PURPLE
    Increments automatically when a player is killed by a player on the dark purple team.

  - ### KILLED_BY_TEAM_GOLD

    static final Criteria KILLED_BY_TEAM_GOLD
    Increments automatically when a player is killed by a player on the gold team.

  - ### KILLED_BY_TEAM_GRAY

    static final Criteria KILLED_BY_TEAM_GRAY
    Increments automatically when a player is killed by a player on the gray team.

  - ### KILLED_BY_TEAM_DARK_GRAY

    static final Criteria KILLED_BY_TEAM_DARK_GRAY
    Increments automatically when a player is killed by a player on the dark gray team.

  - ### KILLED_BY_TEAM_BLUE

    static final Criteria KILLED_BY_TEAM_BLUE
    Increments automatically when a player is killed by a player on the blue team.

  - ### KILLED_BY_TEAM_GREEN

    static final Criteria KILLED_BY_TEAM_GREEN
    Increments automatically when a player is killed by a player on the green team.

  - ### KILLED_BY_TEAM_AQUA

    static final Criteria KILLED_BY_TEAM_AQUA
    Increments automatically when a player is killed by a player on the aqua team.

  - ### KILLED_BY_TEAM_RED

    static final Criteria KILLED_BY_TEAM_RED
    Increments automatically when a player is killed by a player on the red team.

  - ### KILLED_BY_TEAM_LIGHT_PURPLE

    static final Criteria KILLED_BY_TEAM_LIGHT_PURPLE
    Increments automatically when a player is killed by a player on the light purple team.

  - ### KILLED_BY_TEAM_YELLOW

    static final Criteria KILLED_BY_TEAM_YELLOW
    Increments automatically when a player is killed by a player on the yellow team.

  - ### KILLED_BY_TEAM_WHITE

    static final Criteria KILLED_BY_TEAM_WHITE
    Increments automatically when a player is killed by a player on the white team.

- ## 方法详细资料

  - ### getName

    @NotNull @NotNull String getName()
    Get the name of this criteria (its unique id).
    返回:
      the name

  - ### isReadOnly

    boolean isReadOnly()
    Get whether or not this criteria is read only. If read only, scoreboards with this criteria cannot have their scores changed.
    返回:
      true if read only, false otherwise

  - ### getDefaultRenderType

    @NotNull @NotNull RenderType getDefaultRenderType()
    Get the `RenderType` used by default for this criteria.
    返回:
      the default render type

  - ### statistic

    @NotNull static @NotNull Criteria statistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material)
    Get a `Criteria` for the specified statistic pertaining to blocks or items.

    This method expects a `Statistic` of `Statistic.Type.BLOCK` or `Statistic.Type.ITEM` and the `Material` matching said type (e.g. BLOCK statistics require materials where `Material.isBlock()` is true). This acts as a convenience to create more complex compound criteria such as those that increment on block breaks, or item uses. An example would be `Criteria.statistic(Statistic.CRAFT_ITEM, Material.STICK)`, returning a Criteria representing "minecraft.crafted:minecraft.stick" which will increment when the player crafts a stick.

    If the provided statistic does not require additional data, `statistic(Statistic)` is called and returned instead.

    This method provides no guarantee that any given criteria exists on the vanilla server.

    参数:
      `statistic` - the statistic for which to get a criteria
      `material` - the relevant material
    返回:
      the criteria
    抛出:
      `IllegalArgumentException` - if `Statistic.getType()` is anything other than `Statistic.Type.BLOCK` or `Statistic.Type.ITEM`
      `IllegalArgumentException` - if `Statistic.getType()` is `Statistic.Type.BLOCK`, but `Material.isBlock()` is false
      `IllegalArgumentException` - if `Statistic.getType()` is `Statistic.Type.ITEM`, but `Material.isItem()` is false

  - ### statistic

    @NotNull static @NotNull Criteria statistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType)
    Get a `Criteria` for the specified statistic pertaining to an entity type.

    This method expects a `Statistic` of `Statistic.Type.ENTITY`. This acts as a convenience to create more complex compound criteria such as being killed by a specific entity type. An example would be `Criteria.statistic(Statistic.KILL_ENTITY, EntityType.CREEPER)`, returning a Criteria representing "minecraft.killed:minecraft.creeper" which will increment when the player kills a creepers.

    If the provided statistic does not require additional data, `statistic(Statistic)` is called and returned instead.

    This method provides no guarantee that any given criteria exists on the vanilla server.

    参数:
      `statistic` - the statistic for which to get a criteria
      `entityType` - the relevant entity type
    返回:
      the criteria
    抛出:
      `IllegalArgumentException` - if `Statistic.getType()` is not `Statistic.Type.ENTITY`

  - ### statistic

    @NotNull static @NotNull Criteria statistic(@NotNull @NotNull Statistic statistic)
    Get a `Criteria` for the specified statistic.

    An example would be `Criteria.statistic(Statistic.FLY_ONE_CM)`, returning a Criteria representing "minecraft.custom:minecraft.aviate_one_cm" which will increment when the player flies with an elytra.

    This method provides no guarantee that any given criteria exists on the vanilla server. All statistics are accepted, however some may not operate as expected if additional data is required. For block/item-related statistics, see `statistic(Statistic, Material)`, and for entity-related statistics, see `statistic(Statistic, EntityType)`

    参数:
      `statistic` - the statistic for which to get a criteria
    返回:
      the criteria

  - ### create

    @NotNull static @NotNull Criteria create(@NotNull @NotNull String name)
    Get (or create) a new `Criteria` by its name.
    参数:
      `name` - the criteria name
    返回:
      the created criteria