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
RenderRange
public int RenderRange { get; set; }
Property Value
ShowOnlyWhenTargeted
Whether or not to show the nametag constantly or only when being looked at.
public bool ShowOnlyWhenTargeted { get; set; }
Property Value
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
EntityPropertiesattributes
JsonObjectThe 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
SetName(string)
Sets the display name of the entity to playername.
public void SetName(string playername)
Parameters
playername
string