TargetedEntity

Indicates which entity should be targeted inside a predicate.

Refer to the documentation of the various entries for a more detailed description.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.predicate.TargetedEntity;

Extending Enum<TargetedEntity>

TargetedEntity extends Enum<TargetedEntity>. That means all methods available in Enum<TargetedEntity> are also available in TargetedEntity

Static Properties

名称TypeHas GetterHas SetterDescription
ACTORTargetedEntitytruefalseThe actor that caused the loot table roll or otherwise acted.

Examples of an actor can be the creeper that exploded or the player that gained an advancement.
DIRECT_KILLERTargetedEntitytruefalseThe entity that directly caused the death of the actor.

The entity is the entity that dealt the final blow to the actor, rather than its actual killer. As an example,
if a skeleton killed a creeper by shooting an arrow, the direct killer will be the arrow.
KILLERTargetedEntitytruefalseThe entity that caused the death of the actor.

This entity is the actual killer, instead of the entity that actually dealt the final blow to the actor. As an
example, if a skeleton killed a creeper by shooting an arrow, the killer will be the skeleton.
PLAYER_KILLERTargetedEntitytruefalseThe player that caused the death of the actor, if applicable.

This entity is exactly the same as the killer, except it is only available if the final blow was dealt by a
player.