Table of Contents

Class EntityBehaviorNameTag

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class EntityBehaviorNameTag : EntityBehavior
Inheritance
EntityBehaviorNameTag
Inherited Members
Extension Methods

Constructors

EntityBehaviorNameTag(Entity)

public EntityBehaviorNameTag(Entity entity)

Parameters

entity Entity

Properties

DisplayName

The display name for the entity.

public string DisplayName { get; }

Property Value

string

RenderRange

public int RenderRange { get; set; }

Property Value

int

ShowOnlyWhenTargeted

Whether or not to show the nametag constantly or only when being looked at.

public bool ShowOnlyWhenTargeted { get; set; }

Property Value

bool

Methods

Initialize(EntityProperties, JsonObject)

Initializes the entity.
If your code modifies the supplied attributes (not recommended!), then your changes will apply to all entities of the same type.

public override void Initialize(EntityProperties entityType, JsonObject attributes)

Parameters

entityType EntityProperties
attributes JsonObject

The attributes of this entity.

OnEntitySpawn()

The event fired when the entity is spawned (not called when loaded from the savegame).

public override void OnEntitySpawn()

PropertyName()

The name of the property tied to this entity behavior.

public override string PropertyName()

Returns

string

SetName(string)

Sets the display name of the entity to playername.

public void SetName(string playername)

Parameters

playername string