mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-05-31 09:52:07 +00:00
c526e9a40c
- Add (very basic) details provider for entities. - Add commands.getEntity(selector) function, which gets details for all matching entities. Fixes #2383
1.8 KiB
1.8 KiB
module: [kind=reference] entity_details since: 1.118.0
Entity details
Some functions in CC: Tweaked (such as [commands.getEntities]) provide a way to get information about an entity.
This page details information about entities that CC: Tweaked may return.
Basic information
Entity information will always contain:
name: string: The namespaced ID for this entity, e.g.minecraft:player. See the Minecraft wiki for a list of vanilla entity IDs.
Example
A creeper:
{
name = "minecraft:creeper",
count = 32,
}
Display information
The display name of the entity.
displayName: string: The translated display name of the entity. This uses the server's language. This will typically be English on multi-player servers, and your current language on single player.
Example
A creeper:
{
name = "minecraft:creeper",
displayName = "Creeper",
}
Health
The health of an entity.
health: number: The current health of the entity.maxHealth: number: The maximum health of an entity.
Example
A player at max health.
{
name = "minecraft:player",
displayName = "Alex",
health = 20,
maxHealth = 20,
}
Entity tags
The tags an entity of this type has.
tags: { [string] = boolean }: The set of tags for this entity. This is a mapping of tag name totrue.