Files

1.9 KiB

IScriptEntity.unlockRotation

← IScriptEntity · ← Master

Parça 8/17 · önceki · sonraki

Get combined light value of where the entity is currently standing. In order to get torch and sky light values separately, see the example below to "unpack" the combined value.

var light = c.getPlayer().getCombinedLight(); var skyLight = light / 65536 / 15; var torchLight = light % 65536 / 15;

// Do something with skyLight and torchLight

getName

java.lang.String getName()

Get entity name.

setName

void setName(java.lang.String name)

Set entity name.

setInvisible

void setInvisible(boolean invisible)

Set entity to invisible.

getFullData

INBTCompound getFullData()

Get entity's full (copy of its) NBT data.

setFullData

void setFullData(INBTCompound data)

Overwrite NBT data of this entity. WARNING: use it only if you know what are you doing as this method can corrupt entities.

getEntityData

INBTCompound getEntityData()

Get Forge's custom tag compound in which you can story any data you want.

There is no setter method as you can directly work with returned NBT compound. Any changes to returned compound will be reflected upon entity's data.

isPlayer

boolean isPlayer()

Check whether this entity is a player.

isNpc

@Deprecated boolean isNpc()

Deprecated. Check whether this entity is an NPC.

isNPC

boolean isNPC()

Check whether this entity is an NPC.

isItem

boolean isItem()

Check whether this entity is an item.

isLivingBase

boolean isLivingBase()

Check whether this entity is living base.

isSame

boolean isSame(IScriptEntity entity)

Check whether this entity is same as given entity.

isEntityInRadius

boolean isEntityInRadius(IScriptEntity entity, double radius)

Check if an entity is in a radius of another specific entity