HitResultHelper.Entity
com.jsmacrosce.jsmacros.client.api.helper.world.HitResultHelper.Entity
A target that carries the entity and the hit location recorded by the hit result.
js
const interactions = Player.interactions();
const target = interactions === null ? null : interactions.getTarget();
if (target instanceof HitResults.Entity) {
Chat.log(`the crosshair is on ${target.getEntity().getName()}`);
}Available in scripts as HitResults.Entity.
Nested type declared in HitResultHelper.
Constructors
new HitResultHelper.Entity
new HitResultHelper.Entity(EntityHitResult base)#Wraps the supplied entity hit result.
Parameters:
base: entity hit result to wrap
Methods
asEntity
asEntity(): HitResultHelper.Entity#Returns this entity-hit helper.
Returns: this entity-hit helper
getEntity
The hit entity wrapped in its matching EntityHelper subtype.
Returns: the hit entity wrapped in its matching helper subtype.