MCEntity

导入相关包

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.entity.MCEntity;

方法

addTag

Return Type: boolean

ZenScript
Copy
MCEntity.addTag(tag as string) as boolean
参数类型描述
tagstringNo Description Provided
addVelocity

Return Type: void

ZenScript
Copy
MCEntity.addVelocity(x as double, y as double, z as double) as void
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
applyEntityCollision

Return Type: void

ZenScript
Copy
MCEntity.applyEntityCollision(entityIn as MCEntity) as void
参数类型描述
entityInMCEntityNo Description Provided
canSwim

Return Type: boolean

ZenScript
Copy
MCEntity.canSwim() as boolean
myMCEntity.canSwim();
changeDimension

Return Type: void

ZenScript
Copy
MCEntity.changeDimension(world as MCServerWorld) as void
参数类型描述
worldMCServerWorldNo Description Provided
extinguish

Return Type: void

ZenScript
Copy
MCEntity.extinguish() as void
myMCEntity.extinguish();
forceFireTicks

Return Type: void

ZenScript
Copy
MCEntity.forceFireTicks(ticks as int) as void
参数类型描述
ticksintNo Description Provided
forceSetPosition

Return Type: void

ZenScript
Copy
MCEntity.forceSetPosition(x as double, y as double, z as double) as void
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
getAir

Return Type: int

ZenScript
Copy
MCEntity.getAir() as int
myMCEntity.getAir();
getBrightness

Return Type: float

ZenScript
Copy
MCEntity.getBrightness() as float
myMCEntity.getBrightness();
getData

Return Type: MapData

ZenScript
Copy
MCEntity.getData() as MapData
myMCEntity.getData();
getDistance

Return Type: float

ZenScript
Copy
MCEntity.getDistance(entityIn as MCEntity) as float
参数类型描述
entityInMCEntityNo Description Provided
getDistanceSq

Return Type: double

ZenScript
Copy
MCEntity.getDistanceSq(entityIn as MCEntity) as double
参数类型描述
entityInMCEntityNo Description Provided
getDistanceSq

Return Type: double

ZenScript
Copy
MCEntity.getDistanceSq(x as double, y as double, z as double) as double
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
getEntityId

Return Type: int

ZenScript
Copy
MCEntity.getEntityId() as int
myMCEntity.getEntityId();
getFireTimer

Return Type: int

ZenScript
Copy
MCEntity.getFireTimer() as int
myMCEntity.getFireTimer();
getMaxInPortalTime

Return Type: int

ZenScript
Copy
MCEntity.getMaxInPortalTime() as int
myMCEntity.getMaxInPortalTime();
getName

Return Type: string

ZenScript
Copy
MCEntity.getName() as string
myMCEntity.getName();
getTags

Return Type: Set<string>

ZenScript
Copy
MCEntity.getTags() as Set<string>
myMCEntity.getTags();
getType

Return Type: MCEntityType

ZenScript
Copy
MCEntity.getType() as MCEntityType
myMCEntity.getType();
getUUID

Return Type: string

ZenScript
Copy
MCEntity.getUUID() as string
myMCEntity.getUUID();
getWorld

Return Type: MCWorld

ZenScript
Copy
MCEntity.getWorld() as MCWorld
myMCEntity.getWorld();
hasNoGravity

Return Type: boolean

ZenScript
Copy
MCEntity.hasNoGravity() as boolean
myMCEntity.hasNoGravity();
isEntityInRange

Return Type: boolean

ZenScript
Copy
MCEntity.isEntityInRange(entity as MCEntity, distance as double) as boolean
参数类型描述
entityMCEntityNo Description Provided
distancedoubleNo Description Provided
isImmuneToFire

Return Type: boolean

ZenScript
Copy
MCEntity.isImmuneToFire() as boolean
myMCEntity.isImmuneToFire();
isInLava

Return Type: boolean

ZenScript
Copy
MCEntity.isInLava() as boolean
myMCEntity.isInLava();
isInWater

Return Type: boolean

ZenScript
Copy
MCEntity.isInWater() as boolean
myMCEntity.isInWater();
isInWaterOrBubbleColumn

Return Type: boolean

ZenScript
Copy
MCEntity.isInWaterOrBubbleColumn() as boolean
myMCEntity.isInWaterOrBubbleColumn();
isInWaterRainOrBubbleColumn

Return Type: boolean

ZenScript
Copy
MCEntity.isInWaterRainOrBubbleColumn() as boolean
myMCEntity.isInWaterRainOrBubbleColumn();
isOffsetPositionInLiquid

Return Type: boolean

ZenScript
Copy
MCEntity.isOffsetPositionInLiquid(x as double, y as double, z as double) as boolean
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
isOnGround

Return Type: boolean

ZenScript
Copy
MCEntity.isOnGround() as boolean
myMCEntity.isOnGround();
isSilent

Return Type: boolean

ZenScript
Copy
MCEntity.isSilent() as boolean
myMCEntity.isSilent();
isSpectator

Return Type: boolean

ZenScript
Copy
MCEntity.isSpectator() as boolean
myMCEntity.isSpectator();
isWet

Return Type: boolean

ZenScript
Copy
MCEntity.isWet() as boolean
myMCEntity.isWet();
moveForced

Return Type: void

ZenScript
Copy
MCEntity.moveForced(x as double, y as double, z as double) as void
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
onCollideWithPlayer

Return Type: void

ZenScript
Copy
MCEntity.onCollideWithPlayer(entityIn as MCPlayerEntity) as void
参数类型描述
entityInMCPlayerEntity #MC玩家实体No Description Provided
onKillCommand

Return Type: void

ZenScript
Copy
MCEntity.onKillCommand() as void
myMCEntity.onKillCommand();
onLivingFall

Return Type: boolean

ZenScript
Copy
MCEntity.onLivingFall(distance as float, damageMultiplier as float) as boolean
参数类型描述
distancefloatNo Description Provided
damageMultiplierfloatNo Description Provided
removeTag

Return Type: boolean

ZenScript
Copy
MCEntity.removeTag(tag as string) as boolean
参数类型描述
tagstringNo Description Provided
setAir

Return Type: void

ZenScript
Copy
MCEntity.setAir(air as int) as void
参数类型描述
airintNo Description Provided
setEntityId

Return Type: void

ZenScript
Copy
MCEntity.setEntityId(id as int) as void
参数类型描述
idintNo Description Provided
setFire

Return Type: void

ZenScript
Copy
MCEntity.setFire(seconds as int) as void
参数类型描述
secondsintNo Description Provided
setNoGravity

Return Type: void

ZenScript
Copy
MCEntity.setNoGravity(noGravity as boolean) as void
参数类型描述
noGravitybooleanNo Description Provided
setOnGround

Return Type: void

ZenScript
Copy
MCEntity.setOnGround(grounded as boolean) as void
参数类型描述
groundedbooleanNo Description Provided
setPosition

Return Type: void

ZenScript
Copy
MCEntity.setPosition(x as double, y as double, z as double) as void
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
setSilent

Return Type: void

ZenScript
Copy
MCEntity.setSilent(isSilent as boolean) as void
参数类型描述
isSilentbooleanNo Description Provided
teleportKeepLoaded

Teleports the entity, forcing the destination to stay loaded for a short time

Return Type: void

ZenScript
Copy
MCEntity.teleportKeepLoaded(x as double, y as double, z as double) as void
参数类型描述
xdoubleNo Description Provided
ydoubleNo Description Provided
zdoubleNo Description Provided
updateData

Return Type: void

ZenScript
Copy
MCEntity.updateData(data as MapData) as void
参数类型描述
dataMapData #地图数据No Description Provided

参数

名称类型可获得可设置
airinttruetrue
dataMapData #地图数据truefalse
facingDirectionsDirection[]truefalse
namestringtruefalse
uuidstringtruefalse
worldMCWorldtruefalse