Skip to content

Entity

Generic entitiessource

Derived types: BGBackLayerDoor, BGEggshipRoom, BGRelativeElement, BGShopEntrance, BGShopKeeperPrime, BGSurfaceStar, BGTutorialSign, BoulderSpawner, BurningRopeEffect, CameraFlash, CinematicAnchor, CrossBeam, CursedEffect, DMAlienBlast, DMSpawning, DecoRegeneratingBlock, DestructibleBG, DustWallApep, EggplantThrower, Floor, FrostBreathEffect, LimbAnchor, Liquid, LogicalAnchovyFlock, LogicalDoor, LogicalDrain, LogicalMiniGame, LogicalRegeneratingBlock, LogicalSound, LogicalTrapTrigger, Movable, OnFireEffect, OuroboroCameraAnchor, OuroboroCameraZoomin, PalaceSign, PoisonedEffect, Portal, RoomLight, ShootingStarSpawner, SplashBubbleGenerator, WetEffect

Fields

abs_x

numberread only

Absolute position in the world, even if overlaid. Might be a frame off since it's updated with apply_movement function and so it does not update if game moves the entity in different way after movement is processed. Use get_absolute_position for precise. Read only.

source

abs_y

numberread only

Absolute position in the world, even if overlaid. Might be a frame off since it's updated with apply_movement function and so it does not update if game moves the entity in different way after movement is processed. Use get_absolute_position for precise. Read only.

source

angle

number

source

animation_frame

integer

Number (id) of the sprite in the texture

source

draw_depth

integer

Depth level that this entity is drawn on. Don't edit this directly, use set_draw_depth function

source

flags

ENT_FLAG

see flags.hpp entity_flags

source

height

number

Height of the sprite

source

hitbox_enabled

boolean

source

hitboxx

number

Half of the width of the hitbox

source

hitboxy

number

Half of the height of the hitbox

source

layer

integer

Use set_layer to change

source

more_flags

ENT_MORE_FLAG

see flags.hpp more_flags

source

offsetx

number

Offset of the hitbox in relation to the entity position

source

offsety

number

Offset of the hitbox in relation to the entity position

source

overlay

anyproperty

source

rendering_info

RenderInfo?

source

special_offsetx

number

Special offset used for entities attached to others (or picked by others) that need to flip to the other side when the parent flips sides

source

special_offsety

number

Special offset used for entities attached to others (or picked by others) that need to flip to the other side when the parent flips sides

source

tile_height

number

Size of the sprite in the texture

source

tile_width

number

Size of the sprite in the texture

source

type

EntityDB?

Type of the entity, contains special properties etc. If you want to edit them just for this entity look at the EntityDB

source

uid

integer

Unique id of the entity, save it to variable to check this entity later (don't use the whole Entity type as it will be replaced with a different one when this is destroyed)

source

user_data

anyproperty

You can put any arbitrary lua object here for custom entities or player stats, which is then saved across level transitions for players and carried items, mounts etc... This field is local to the script and multiple scripts can write different things in the same entity. The data is saved right before ON.PRE_LOAD_SCREEN from a level and loaded right before ON.POST_LOAD_SCREEN to a level or transition. It is not available yet in post_entity_spawn, but that is a good place to initialize it for new custom entities. See example for more.

source

width

number

Width of the sprite

source

x

number

Position of the entity in the world, or relative to overlay if attached to something. Use get_absolute_position to get real position of anything in the game world.

source

y

number

Position of the entity in the world, or relative to overlay if attached to something. Use get_absolute_position to get real position of anything in the game world.

source

Methods

activate

function Entity:activate(activator?: Entity)
activator?: Entityoptional
source

apply_db

function Entity:apply_db()
source

apply_layer

function Entity:apply_layer()
source

apply_metadata

function Entity:apply_metadata(metadata: integer)
metadata: integer
source

as_acidbubble

function Entity.as_acidbubble(): AcidBubble?

Returns AcidBubble? (may be nil)

source

as_alien

function Entity.as_alien(): Alien?

Returns Alien? (may be nil)

source

as_altar

function Entity.as_altar(): Altar?

Returns Altar? (may be nil)

source

as_ammit

function Entity.as_ammit(): Ammit?

Returns Ammit? (may be nil)

source

as_ankhpowerup

function Entity.as_ankhpowerup(): AnkhPowerup?

Returns AnkhPowerup? (may be nil)

source

as_anubis

function Entity.as_anubis(): Anubis?

Returns Anubis? (may be nil)

source

as_apephead

function Entity.as_apephead(): ApepHead?

Returns ApepHead? (may be nil)

source

as_apeppart

function Entity.as_apeppart(): ApepPart?

Returns ApepPart? (may be nil)

source

as_arrow

function Entity.as_arrow(): Arrow?

Returns Arrow? (may be nil)

source

as_arrowtrap

function Entity.as_arrowtrap(): Arrowtrap?

Returns Arrowtrap? (may be nil)

source

as_axolotl

function Entity.as_axolotl(): Axolotl?

Returns Axolotl? (may be nil)

source

as_axolotlshot

function Entity.as_axolotlshot(): AxolotlShot?

Returns AxolotlShot? (may be nil)

source

as_backpack

function Entity.as_backpack(): Backpack?

Returns Backpack? (may be nil)

source

as_bat

function Entity.as_bat(): Bat?

Returns Bat? (may be nil)

source

as_bee

function Entity.as_bee(): Bee?

Returns Bee? (may be nil)

source

as_beg

function Entity.as_beg(): Beg?

Returns Beg? (may be nil)

source

as_bgbacklayerdoor

function Entity.as_bgbacklayerdoor(): BGBackLayerDoor?

Returns BGBackLayerDoor? (may be nil)

source

as_bgeggshiproom

function Entity.as_bgeggshiproom(): BGEggshipRoom?

Returns BGEggshipRoom? (may be nil)

source

as_bgfloatingdebris

function Entity.as_bgfloatingdebris(): BGFloatingDebris?

Returns BGFloatingDebris? (may be nil)

source

as_bgmovingstar

function Entity.as_bgmovingstar(): BGMovingStar?

Returns BGMovingStar? (may be nil)

source

as_bgrelativeelement

function Entity.as_bgrelativeelement(): BGRelativeElement?

Returns BGRelativeElement? (may be nil)

source

as_bgshootingstar

function Entity.as_bgshootingstar(): BGShootingStar?

Returns BGShootingStar? (may be nil)

source

as_bgshopentrance

function Entity.as_bgshopentrance(): BGShopEntrance?

Returns BGShopEntrance? (may be nil)

source

as_bgshopkeeperprime

function Entity.as_bgshopkeeperprime(): BGShopKeeperPrime?

Returns BGShopKeeperPrime? (may be nil)

source

as_bgsurfacelayer

function Entity.as_bgsurfacelayer(): BGSurfaceLayer?

Returns BGSurfaceLayer? (may be nil)

source

as_bgsurfacestar

function Entity.as_bgsurfacestar(): BGSurfaceStar?

Returns BGSurfaceStar? (may be nil)

source

as_bgtutorialsign

function Entity.as_bgtutorialsign(): BGTutorialSign?

Returns BGTutorialSign? (may be nil)

source

as_bigspeartrap

function Entity.as_bigspeartrap(): BigSpearTrap?

Returns BigSpearTrap? (may be nil)

source

as_birdies

function Entity.as_birdies(): Birdies?

Returns Birdies? (may be nil)

source

as_bodyguard

function Entity.as_bodyguard(): Bodyguard?

Returns Bodyguard? (may be nil)

source

as_bomb

function Entity.as_bomb(): Bomb?

Returns Bomb? (may be nil)

source

as_boneblock

function Entity.as_boneblock(): BoneBlock?

Returns BoneBlock? (may be nil)

source

as_boombox

function Entity.as_boombox(): Boombox?

Returns Boombox? (may be nil)

source

as_boomerang

function Entity.as_boomerang(): Boomerang?

Returns Boomerang? (may be nil)

source

as_boulder

function Entity.as_boulder(): Boulder?

Returns Boulder? (may be nil)

source

as_boulderspawner

function Entity.as_boulderspawner(): BoulderSpawner?

Returns BoulderSpawner? (may be nil)

source

as_bow

function Entity.as_bow(): Bow?

Returns Bow? (may be nil)

source

as_bullet

function Entity.as_bullet(): Bullet?

Returns Bullet? (may be nil)

source

as_burningropeeffect

function Entity.as_burningropeeffect(): BurningRopeEffect?

Returns BurningRopeEffect? (may be nil)

source

as_button

function Entity.as_button(): Button?

Returns Button? (may be nil)

source

as_cameraflash

function Entity.as_cameraflash(): CameraFlash?

Returns CameraFlash? (may be nil)

source

as_cape

function Entity.as_cape(): Cape?

Returns Cape? (may be nil)

source

as_catmummy

function Entity.as_catmummy(): CatMummy?

Returns CatMummy? (may be nil)

source

as_caveman

function Entity.as_caveman(): Caveman?

Returns Caveman? (may be nil)

source

as_cavemanshopkeeper

function Entity.as_cavemanshopkeeper(): CavemanShopkeeper?

Returns CavemanShopkeeper? (may be nil)

source

as_chain

function Entity.as_chain(): Chain?

Returns Chain? (may be nil)

source

as_chainedpushblock

function Entity.as_chainedpushblock(): ChainedPushBlock?

Returns ChainedPushBlock? (may be nil)

source

as_chest

function Entity.as_chest(): Chest?

Returns Chest? (may be nil)

source

as_cinematicanchor

function Entity.as_cinematicanchor(): CinematicAnchor?

Returns CinematicAnchor? (may be nil)

source

as_cityofgolddoor

function Entity.as_cityofgolddoor(): CityOfGoldDoor?

Returns CityOfGoldDoor? (may be nil)

source

as_clambase

function Entity.as_clambase(): ClamBase?

Returns ClamBase? (may be nil)

source

as_claw

function Entity.as_claw(): Claw?

Returns Claw? (may be nil)

source

as_climbablerope

function Entity.as_climbablerope(): ClimbableRope?

Returns ClimbableRope? (may be nil)

source

as_clonegunshot

function Entity.as_clonegunshot(): CloneGunShot?

Returns CloneGunShot? (may be nil)

source

as_cobra

function Entity.as_cobra(): Cobra?

Returns Cobra? (may be nil)

source

as_coffin

function Entity.as_coffin(): Coffin?

Returns Coffin? (may be nil)

source

as_coin

function Entity.as_coin(): Coin?

Returns Coin? (may be nil)

source

as_container

function Entity.as_container(): Container?

Returns Container? (may be nil)

source

as_conveyorbelt

function Entity.as_conveyorbelt(): ConveyorBelt?

Returns ConveyorBelt? (may be nil)

source

as_cookfire

function Entity.as_cookfire(): CookFire?

Returns CookFire? (may be nil)

source

as_crabman

function Entity.as_crabman(): Crabman?

Returns Crabman? (may be nil)

source

as_critter

function Entity.as_critter(): Critter?

Returns Critter? (may be nil)

source

as_critterbeetle

function Entity.as_critterbeetle(): CritterBeetle?

Returns CritterBeetle? (may be nil)

source

as_critterbutterfly

function Entity.as_critterbutterfly(): CritterButterfly?

Returns CritterButterfly? (may be nil)

source

as_crittercrab

function Entity.as_crittercrab(): CritterCrab?

Returns CritterCrab? (may be nil)

source

as_critterdrone

function Entity.as_critterdrone(): CritterDrone?

Returns CritterDrone? (may be nil)

source

as_critterfirefly

function Entity.as_critterfirefly(): CritterFirefly?

Returns CritterFirefly? (may be nil)

source

as_critterfish

function Entity.as_critterfish(): CritterFish?

Returns CritterFish? (may be nil)

source

as_critterlocust

function Entity.as_critterlocust(): CritterLocust?

Returns CritterLocust? (may be nil)

source

as_critterpenguin

function Entity.as_critterpenguin(): CritterPenguin?

Returns CritterPenguin? (may be nil)

source

as_critterslime

function Entity.as_critterslime(): CritterSlime?

Returns CritterSlime? (may be nil)

source

as_crittersnail

function Entity.as_crittersnail(): CritterSnail?

Returns CritterSnail? (may be nil)

source

as_crocman

function Entity.as_crocman(): Crocman?

Returns Crocman? (may be nil)

source

as_crossbeam

function Entity.as_crossbeam(): CrossBeam?

Returns CrossBeam? (may be nil)

source

as_crushelevator

function Entity.as_crushelevator(): CrushElevator?

Returns CrushElevator? (may be nil)

source

as_crushtrap

function Entity.as_crushtrap(): Crushtrap?

Returns Crushtrap? (may be nil)

source

as_cursedeffect

function Entity.as_cursedeffect(): CursedEffect?

Returns CursedEffect? (may be nil)

source

as_cursedpot

function Entity.as_cursedpot(): CursedPot?

Returns CursedPot? (may be nil)

source

as_decorateddoor

function Entity.as_decorateddoor(): DecoratedDoor?

Returns DecoratedDoor? (may be nil)

source

as_decoregeneratingblock

function Entity.as_decoregeneratingblock(): DecoRegeneratingBlock?

Returns DecoRegeneratingBlock? (may be nil)

source

as_destructiblebg

function Entity.as_destructiblebg(): DestructibleBG?

Returns DestructibleBG? (may be nil)

source

as_dmalienblast

function Entity.as_dmalienblast(): DMAlienBlast?

Returns DMAlienBlast? (may be nil)

source

as_dmspawning

function Entity.as_dmspawning(): DMSpawning?

Returns DMSpawning? (may be nil)

source

as_door

function Entity.as_door(): Door?

Returns Door? (may be nil)

source

as_drill

function Entity.as_drill(): Drill?

Returns Drill? (may be nil)

source

as_dummypurchasableentity

function Entity.as_dummypurchasableentity(): DummyPurchasableEntity?

Returns DummyPurchasableEntity? (may be nil)

source

as_dustwallapep

function Entity.as_dustwallapep(): DustWallApep?

Returns DustWallApep? (may be nil)

source

as_eggplantminister

function Entity.as_eggplantminister(): EggplantMinister?

Returns EggplantMinister? (may be nil)

source

as_eggplantthrower

function Entity.as_eggplantthrower(): EggplantThrower?

Returns EggplantThrower? (may be nil)

source

as_eggsac

function Entity.as_eggsac(): EggSac?

Returns EggSac? (may be nil)

source

as_eggshipcenterjetflame

function Entity.as_eggshipcenterjetflame(): EggshipCenterJetFlame?

Returns EggshipCenterJetFlame? (may be nil)

source

as_eggshipdoor

function Entity.as_eggshipdoor(): EggShipDoor?

Returns EggShipDoor? (may be nil)

source

as_eggshipdoors

function Entity.as_eggshipdoors(): EggShipDoorS?

Returns EggShipDoorS? (may be nil)

source

as_elevator

function Entity.as_elevator(): Elevator?

Returns Elevator? (may be nil)

source

as_empressgrave

function Entity.as_empressgrave(): EmpressGrave?

Returns EmpressGrave? (may be nil)

source

as_entity

function Entity.as_entity(): Entity?

Returns Entity? (may be nil)

source

as_excalibur

function Entity.as_excalibur(): Excalibur?

Returns Excalibur? (may be nil)

source

as_exitdoor

function Entity.as_exitdoor(): ExitDoor?

Returns ExitDoor? (may be nil)

source

as_explosion

function Entity.as_explosion(): Explosion?

Returns Explosion? (may be nil)

source

as_fallingplatform

function Entity.as_fallingplatform(): FallingPlatform?

Returns FallingPlatform? (may be nil)

source

as_fireball

function Entity.as_fireball(): Fireball?

Returns Fireball? (may be nil)

source

as_firebug

function Entity.as_firebug(): Firebug?

Returns Firebug? (may be nil)

source

as_firebugunchained

function Entity.as_firebugunchained(): FirebugUnchained?

Returns FirebugUnchained? (may be nil)

source

as_firefrog

function Entity.as_firefrog(): FireFrog?

Returns FireFrog? (may be nil)

source

as_fish

function Entity.as_fish(): Fish?

Returns Fish? (may be nil)

source

as_flame

function Entity.as_flame(): Flame?

Returns Flame? (may be nil)

source

as_flamesize

function Entity.as_flamesize(): FlameSize?

Returns FlameSize? (may be nil)

source

as_floor

function Entity.as_floor(): Floor?

Returns Floor? (may be nil)

source

as_fly

function Entity.as_fly(): Fly?

Returns Fly? (may be nil)

source

as_flyhead

function Entity.as_flyhead(): FlyHead?

Returns FlyHead? (may be nil)

source

as_forcefield

function Entity.as_forcefield(): ForceField?

Returns ForceField? (may be nil)

source

as_forestsister

function Entity.as_forestsister(): ForestSister?

Returns ForestSister? (may be nil)

source

as_frog

function Entity.as_frog(): Frog?

Returns Frog? (may be nil)

source

as_frostbreatheffect

function Entity.as_frostbreatheffect(): FrostBreathEffect?

Returns FrostBreathEffect? (may be nil)

source

as_frozenliquid

function Entity.as_frozenliquid(): FrozenLiquid?

Returns FrozenLiquid? (may be nil)

source

as_fxalienblast

function Entity.as_fxalienblast(): FxAlienBlast?

Returns FxAlienBlast? (may be nil)

source

as_fxankhbrokenpiece

function Entity.as_fxankhbrokenpiece(): FxAnkhBrokenPiece?

Returns FxAnkhBrokenPiece? (may be nil)

source

as_fxankhrotatingspark

function Entity.as_fxankhrotatingspark(): FxAnkhRotatingSpark?

Returns FxAnkhRotatingSpark? (may be nil)

source

as_fxcompass

function Entity.as_fxcompass(): FxCompass?

Returns FxCompass? (may be nil)

source

as_fxempress

function Entity.as_fxempress(): FxEmpress?

Returns FxEmpress? (may be nil)

source

as_fxfireflylight

function Entity.as_fxfireflylight(): FxFireflyLight?

Returns FxFireflyLight? (may be nil)

source

as_fxhundunneckpiece

function Entity.as_fxhundunneckpiece(): FxHundunNeckPiece?

Returns FxHundunNeckPiece? (may be nil)

source

as_fxjellyfishstar

function Entity.as_fxjellyfishstar(): FxJellyfishStar?

Returns FxJellyfishStar? (may be nil)

source

as_fxjetpackflame

function Entity.as_fxjetpackflame(): FxJetpackFlame?

Returns FxJetpackFlame? (may be nil)

source

as_fxkingusliding

function Entity.as_fxkingusliding(): FxKinguSliding?

Returns FxKinguSliding? (may be nil)

source

as_fxlamassuattack

function Entity.as_fxlamassuattack(): FxLamassuAttack?

Returns FxLamassuAttack? (may be nil)

source

as_fxmainexitdoor

function Entity.as_fxmainexitdoor(): FxMainExitDoor?

Returns FxMainExitDoor? (may be nil)

source

as_fxnecromancerankh

function Entity.as_fxnecromancerankh(): FxNecromancerANKH?

Returns FxNecromancerANKH? (may be nil)

source

as_fxouroborodragonpart

function Entity.as_fxouroborodragonpart(): FxOuroboroDragonPart?

Returns FxOuroboroDragonPart? (may be nil)

source

as_fxouroborooccluder

function Entity.as_fxouroborooccluder(): FxOuroboroOccluder?

Returns FxOuroboroOccluder? (may be nil)

source

as_fxpickupeffect

function Entity.as_fxpickupeffect(): FxPickupEffect?

Returns FxPickupEffect? (may be nil)

source

as_fxplayerindicator

function Entity.as_fxplayerindicator(): FxPlayerIndicator?

Returns FxPlayerIndicator? (may be nil)

source

as_fxquicksand

function Entity.as_fxquicksand(): FxQuickSand?

Returns FxQuickSand? (may be nil)

source

as_fxsalecontainer

function Entity.as_fxsalecontainer(): FxSaleContainer?

Returns FxSaleContainer? (may be nil)

source

as_fxshotgunblast

function Entity.as_fxshotgunblast(): FxShotgunBlast?

Returns FxShotgunBlast? (may be nil)

source

as_fxsorceressattack

function Entity.as_fxsorceressattack(): FxSorceressAttack?

Returns FxSorceressAttack? (may be nil)

source

as_fxsparksmall

function Entity.as_fxsparksmall(): FxSparkSmall?

Returns FxSparkSmall? (may be nil)

source

as_fxspringtrapring

function Entity.as_fxspringtrapring(): FxSpringtrapRing?

Returns FxSpringtrapRing? (may be nil)

source

as_fxtiamathead

function Entity.as_fxtiamathead(): FxTiamatHead?

Returns FxTiamatHead? (may be nil)

source

as_fxtiamattail

function Entity.as_fxtiamattail(): FxTiamatTail?

Returns FxTiamatTail? (may be nil)

source

as_fxtiamattorso

function Entity.as_fxtiamattorso(): FxTiamatTorso?

Returns FxTiamatTorso? (may be nil)

source

as_fxtornjournalpage

function Entity.as_fxtornjournalpage(): FxTornJournalPage?

Returns FxTornJournalPage? (may be nil)

source

as_fxunderwaterbubble

function Entity.as_fxunderwaterbubble(): FxUnderwaterBubble?

Returns FxUnderwaterBubble? (may be nil)

source

as_fxvatbubble

function Entity.as_fxvatbubble(): FxVatBubble?

Returns FxVatBubble? (may be nil)

source

as_fxwaterdrop

function Entity.as_fxwaterdrop(): FxWaterDrop?

Returns FxWaterDrop? (may be nil)

source

as_fxwebbedeffect

function Entity.as_fxwebbedeffect(): FxWebbedEffect?

Returns FxWebbedEffect? (may be nil)

source

as_fxwitchdoctorhint

function Entity.as_fxwitchdoctorhint(): FxWitchdoctorHint?

Returns FxWitchdoctorHint? (may be nil)

source

as_generator

function Entity.as_generator(): Generator?

Returns Generator? (may be nil)

source

as_ghist

function Entity.as_ghist(): Ghist?

Returns Ghist? (may be nil)

source

as_ghost

function Entity.as_ghost(): Ghost?

Returns Ghost? (may be nil)

source

as_ghostbreath

function Entity.as_ghostbreath(): GhostBreath?

Returns GhostBreath? (may be nil)

source

as_giantclamtop

function Entity.as_giantclamtop(): GiantClamTop?

Returns GiantClamTop? (may be nil)

source

as_giantfish

function Entity.as_giantfish(): GiantFish?

Returns GiantFish? (may be nil)

source

as_giantfly

function Entity.as_giantfly(): GiantFly?

Returns GiantFly? (may be nil)

source

as_giantfrog

function Entity.as_giantfrog(): GiantFrog?

Returns GiantFrog? (may be nil)

source

as_goldbar

function Entity.as_goldbar(): Goldbar?

Returns Goldbar? (may be nil)

source

as_goldmonkey

function Entity.as_goldmonkey(): GoldMonkey?

Returns GoldMonkey? (may be nil)

source

as_grub

function Entity.as_grub(): Grub?

Returns Grub? (may be nil)

source

as_gun

function Entity.as_gun(): Gun?

Returns Gun? (may be nil)

source

as_hanganchor

function Entity.as_hanganchor(): HangAnchor?

Returns HangAnchor? (may be nil)

source

as_hangspider

function Entity.as_hangspider(): HangSpider?

Returns HangSpider? (may be nil)

source

as_hangstrand

function Entity.as_hangstrand(): HangStrand?

Returns HangStrand? (may be nil)

source

as_hermitcrab

function Entity.as_hermitcrab(): Hermitcrab?

Returns Hermitcrab? (may be nil)

source

as_honey

function Entity.as_honey(): Honey?

Returns Honey? (may be nil)

source

as_horizontalforcefield

function Entity.as_horizontalforcefield(): HorizontalForceField?

Returns HorizontalForceField? (may be nil)

source

as_hornedlizard

function Entity.as_hornedlizard(): HornedLizard?

Returns HornedLizard? (may be nil)

source

as_hoverpack

function Entity.as_hoverpack(): Hoverpack?

Returns Hoverpack? (may be nil)

source

as_hundun

function Entity.as_hundun(): Hundun?

Returns Hundun? (may be nil)

source

as_hundunchest

function Entity.as_hundunchest(): HundunChest?

Returns HundunChest? (may be nil)

source

as_hundunhead

function Entity.as_hundunhead(): HundunHead?

Returns HundunHead? (may be nil)

source

as_iceslidingsound

function Entity.as_iceslidingsound(): IceSlidingSound?

Returns IceSlidingSound? (may be nil)

source

as_idol

function Entity.as_idol(): Idol?

Returns Idol? (may be nil)

source

as_imp

function Entity.as_imp(): Imp?

Returns Imp? (may be nil)

source

as_jetpack

function Entity.as_jetpack(): Jetpack?

Returns Jetpack? (may be nil)

source

as_jiangshi

function Entity.as_jiangshi(): Jiangshi?

Returns Jiangshi? (may be nil)

source

as_jumpdog

function Entity.as_jumpdog(): JumpDog?

Returns JumpDog? (may be nil)

source

as_junglespearcosmetic

function Entity.as_junglespearcosmetic(): JungleSpearCosmetic?

Returns JungleSpearCosmetic? (may be nil)

source

as_junglespeartrap

function Entity.as_junglespeartrap(): JungleSpearTrap?

Returns JungleSpearTrap? (may be nil)

source

as_jungletraptrigger

function Entity.as_jungletraptrigger(): JungleTrapTrigger?

Returns JungleTrapTrigger? (may be nil)

source

as_kapalapowerup

function Entity.as_kapalapowerup(): KapalaPowerup?

Returns KapalaPowerup? (may be nil)

source

as_kingu

function Entity.as_kingu(): Kingu?

Returns Kingu? (may be nil)

source

as_lahamu

function Entity.as_lahamu(): Lahamu?

Returns Lahamu? (may be nil)

source

as_lamassu

function Entity.as_lamassu(): Lamassu?

Returns Lamassu? (may be nil)

source

as_lampflame

function Entity.as_lampflame(): LampFlame?

Returns LampFlame? (may be nil)

source

as_landmine

function Entity.as_landmine(): Landmine?

Returns Landmine? (may be nil)

source

as_laserbeam

function Entity.as_laserbeam(): LaserBeam?

Returns LaserBeam? (may be nil)

source

as_lasertrap

function Entity.as_lasertrap(): LaserTrap?

Returns LaserTrap? (may be nil)

source

as_lava

function Entity.as_lava(): Lava?

Returns Lava? (may be nil)

source

as_lavamander

function Entity.as_lavamander(): Lavamander?

Returns Lavamander? (may be nil)

source

as_leaf

function Entity.as_leaf(): Leaf?

Returns Leaf? (may be nil)

source

as_leprechaun

function Entity.as_leprechaun(): Leprechaun?

Returns Leprechaun? (may be nil)

source

as_lightarrow

function Entity.as_lightarrow(): LightArrow?

Returns LightArrow? (may be nil)

source

as_lightarrowplatform

function Entity.as_lightarrowplatform(): LightArrowPlatform?

Returns LightArrowPlatform? (may be nil)

source

as_lightemitter

function Entity.as_lightemitter(): LightEmitter?

Returns LightEmitter? (may be nil)

source

as_lightshot

function Entity.as_lightshot(): LightShot?

Returns LightShot? (may be nil)

source

as_limbanchor

function Entity.as_limbanchor(): LimbAnchor?

Returns LimbAnchor? (may be nil)

source

as_liquid

function Entity.as_liquid(): Liquid?

Returns Liquid? (may be nil)

source

as_liquidsurface

function Entity.as_liquidsurface(): LiquidSurface?

Returns LiquidSurface? (may be nil)

source

as_lockeddoor

function Entity.as_lockeddoor(): LockedDoor?

Returns LockedDoor? (may be nil)

source

as_logicalanchovyflock

function Entity.as_logicalanchovyflock(): LogicalAnchovyFlock?

Returns LogicalAnchovyFlock? (may be nil)

source

as_logicalconveyorbeltsound

function Entity.as_logicalconveyorbeltsound(): LogicalConveyorbeltSound?

Returns LogicalConveyorbeltSound? (may be nil)

source

as_logicaldoor

function Entity.as_logicaldoor(): LogicalDoor?

Returns LogicalDoor? (may be nil)

source

as_logicaldrain

function Entity.as_logicaldrain(): LogicalDrain?

Returns LogicalDrain? (may be nil)

source

as_logicalliquidstreamsound

function Entity.as_logicalliquidstreamsound(): LogicalLiquidStreamSound?

Returns LogicalLiquidStreamSound? (may be nil)

source

as_logicalminigame

function Entity.as_logicalminigame(): LogicalMiniGame?

Returns LogicalMiniGame? (may be nil)

source

as_logicalregeneratingblock

function Entity.as_logicalregeneratingblock(): LogicalRegeneratingBlock?

Returns LogicalRegeneratingBlock? (may be nil)

source

as_logicalsound

function Entity.as_logicalsound(): LogicalSound?

Returns LogicalSound? (may be nil)

source

as_logicalstaticsound

function Entity.as_logicalstaticsound(): LogicalStaticSound?

Returns LogicalStaticSound? (may be nil)

source

as_logicaltraptrigger

function Entity.as_logicaltraptrigger(): LogicalTrapTrigger?

Returns LogicalTrapTrigger? (may be nil)

source

as_magmaman

function Entity.as_magmaman(): MagmaMan?

Returns MagmaMan? (may be nil)

source

as_mainexit

function Entity.as_mainexit(): MainExit?

Returns MainExit? (may be nil)

source

as_mantrap

function Entity.as_mantrap(): Mantrap?

Returns Mantrap? (may be nil)

source

as_mattock

function Entity.as_mattock(): Mattock?

Returns Mattock? (may be nil)

source

as_mech

function Entity.as_mech(): Mech?

Returns Mech? (may be nil)

source

as_megajellyfish

function Entity.as_megajellyfish(): MegaJellyfish?

Returns MegaJellyfish? (may be nil)

source

as_megajellyfisheye

function Entity.as_megajellyfisheye(): MegaJellyfishEye?

Returns MegaJellyfishEye? (may be nil)

source

as_minigameasteroid

function Entity.as_minigameasteroid(): MiniGameAsteroid?

Returns MiniGameAsteroid? (may be nil)

source

as_minigameship

function Entity.as_minigameship(): MiniGameShip?

Returns MiniGameShip? (may be nil)

source

as_minigameshipoffset

function Entity.as_minigameshipoffset(): MiniGameShipOffset?

Returns MiniGameShipOffset? (may be nil)

source

as_mole

function Entity.as_mole(): Mole?

Returns Mole? (may be nil)

source

as_monkey

function Entity.as_monkey(): Monkey?

Returns Monkey? (may be nil)

source

as_monster

function Entity.as_monster(): Monster?

Returns Monster? (may be nil)

source

as_mosquito

function Entity.as_mosquito(): Mosquito?

Returns Mosquito? (may be nil)

source

as_motherstatue

function Entity.as_motherstatue(): MotherStatue?

Returns MotherStatue? (may be nil)

source

as_mount

function Entity.as_mount(): Mount?

Returns Mount? (may be nil)

source

as_movable

function Entity.as_movable(): Movable?

Returns Movable? (may be nil)

source

as_movingicon

function Entity.as_movingicon(): MovingIcon?

Returns MovingIcon? (may be nil)

source

as_mummy

function Entity.as_mummy(): Mummy?

Returns Mummy? (may be nil)

source

as_mummyfliessound

function Entity.as_mummyfliessound(): MummyFliesSound?

Returns MummyFliesSound? (may be nil)

source

as_necromancer

function Entity.as_necromancer(): Necromancer?

Returns Necromancer? (may be nil)

source

as_npc

function Entity.as_npc(): NPC?

Returns NPC? (may be nil)

source

as_octopus

function Entity.as_octopus(): Octopus?

Returns Octopus? (may be nil)

source

as_olmec

function Entity.as_olmec(): Olmec?

Returns Olmec? (may be nil)

source

as_olmeccannon

function Entity.as_olmeccannon(): OlmecCannon?

Returns OlmecCannon? (may be nil)

source

as_olmecfloater

function Entity.as_olmecfloater(): OlmecFloater?

Returns OlmecFloater? (may be nil)

source

as_olmecship

function Entity.as_olmecship(): OlmecShip?

Returns OlmecShip? (may be nil)

source

as_olmite

function Entity.as_olmite(): Olmite?

Returns Olmite? (may be nil)

source

as_onfireeffect

function Entity.as_onfireeffect(): OnFireEffect?

Returns OnFireEffect? (may be nil)

source

as_orb

function Entity.as_orb(): Orb?

Returns Orb? (may be nil)

source

as_osirishand

function Entity.as_osirishand(): OsirisHand?

Returns OsirisHand? (may be nil)

source

as_osirishead

function Entity.as_osirishead(): OsirisHead?

Returns OsirisHead? (may be nil)

source

as_ouroborocameraanchor

function Entity.as_ouroborocameraanchor(): OuroboroCameraAnchor?

Returns OuroboroCameraAnchor? (may be nil)

source

as_ouroborocamerazoomin

function Entity.as_ouroborocamerazoomin(): OuroboroCameraZoomin?

Returns OuroboroCameraZoomin? (may be nil)

source

as_palacesign

function Entity.as_palacesign(): PalaceSign?

Returns PalaceSign? (may be nil)

source

as_parachutepowerup

function Entity.as_parachutepowerup(): ParachutePowerup?

Returns ParachutePowerup? (may be nil)

source

as_pet

function Entity.as_pet(): Pet?

Returns Pet? (may be nil)

source

as_pipe

function Entity.as_pipe(): Pipe?

Returns Pipe? (may be nil)

source

as_pipetravelersound

function Entity.as_pipetravelersound(): PipeTravelerSound?

Returns PipeTravelerSound? (may be nil)

source

as_player

function Entity.as_player(): Player?

Returns Player? (may be nil)

source

as_playerbag

function Entity.as_playerbag(): PlayerBag?

Returns PlayerBag? (may be nil)

source

as_playerghost

function Entity.as_playerghost(): PlayerGhost?

Returns PlayerGhost? (may be nil)

source

as_poisonedeffect

function Entity.as_poisonedeffect(): PoisonedEffect?

Returns PoisonedEffect? (may be nil)

source

as_poledeco

function Entity.as_poledeco(): PoleDeco?

Returns PoleDeco? (may be nil)

source

as_portal

function Entity.as_portal(): Portal?

Returns Portal? (may be nil)

source

as_pot

function Entity.as_pot(): Pot?

Returns Pot? (may be nil)

source

as_powerup

function Entity.as_powerup(): Powerup?

Returns Powerup? (may be nil)

source

as_powerupcapable

function Entity.as_powerupcapable(): PowerupCapable?

Returns PowerupCapable? (may be nil)

source

as_present

function Entity.as_present(): Present?

Returns Present? (may be nil)

source

as_prizedispenser

function Entity.as_prizedispenser(): PrizeDispenser?

Returns PrizeDispenser? (may be nil)

source

as_projectile

function Entity.as_projectile(): Projectile?

Returns Projectile? (may be nil)

source

as_protoshopkeeper

function Entity.as_protoshopkeeper(): ProtoShopkeeper?

Returns ProtoShopkeeper? (may be nil)

source

as_punishball

function Entity.as_punishball(): PunishBall?

Returns PunishBall? (may be nil)

source

as_purchasable

function Entity.as_purchasable(): Purchasable?

Returns Purchasable? (may be nil)

source

as_pushblock

function Entity.as_pushblock(): PushBlock?

Returns PushBlock? (may be nil)

source

as_qilin

function Entity.as_qilin(): Qilin?

Returns Qilin? (may be nil)

source

as_quicksand

function Entity.as_quicksand(): QuickSand?

Returns QuickSand? (may be nil)

source

as_quicksandsound

function Entity.as_quicksandsound(): QuickSandSound?

Returns QuickSandSound? (may be nil)

source

as_quillback

function Entity.as_quillback(): Quillback?

Returns Quillback? (may be nil)

source

as_regenblock

function Entity.as_regenblock(): RegenBlock?

Returns RegenBlock? (may be nil)

source

as_robot

function Entity.as_robot(): Robot?

Returns Robot? (may be nil)

source

as_rockdog

function Entity.as_rockdog(): Rockdog?

Returns Rockdog? (may be nil)

source

as_rollingitem

function Entity.as_rollingitem(): RollingItem?

Returns RollingItem? (may be nil)

source

as_roomlight

function Entity.as_roomlight(): RoomLight?

Returns RoomLight? (may be nil)

source

as_roomowner

function Entity.as_roomowner(): RoomOwner?

Returns RoomOwner? (may be nil)

source

as_rubble

function Entity.as_rubble(): Rubble?

Returns Rubble? (may be nil)

source

as_scarab

function Entity.as_scarab(): Scarab?

Returns Scarab? (may be nil)

source

as_scepter

function Entity.as_scepter(): Scepter?

Returns Scepter? (may be nil)

source

as_sceptershot

function Entity.as_sceptershot(): ScepterShot?

Returns ScepterShot? (may be nil)

source

as_scorpion

function Entity.as_scorpion(): Scorpion?

Returns Scorpion? (may be nil)

source

as_shield

function Entity.as_shield(): Shield?

Returns Shield? (may be nil)

source

as_shootingstarspawner

function Entity.as_shootingstarspawner(): ShootingStarSpawner?

Returns ShootingStarSpawner? (may be nil)

source

as_shopkeeper

function Entity.as_shopkeeper(): Shopkeeper?

Returns Shopkeeper? (may be nil)

source

as_skeleton

function Entity.as_skeleton(): Skeleton?

Returns Skeleton? (may be nil)

source

as_skulldroptrap

function Entity.as_skulldroptrap(): SkullDropTrap?

Returns SkullDropTrap? (may be nil)

source

as_sleepbubble

function Entity.as_sleepbubble(): SleepBubble?

Returns SleepBubble? (may be nil)

source

as_slidingwallceiling

function Entity.as_slidingwallceiling(): SlidingWallCeiling?

Returns SlidingWallCeiling? (may be nil)

source

as_snaptrap

function Entity.as_snaptrap(): SnapTrap?

Returns SnapTrap? (may be nil)

source

as_sorceress

function Entity.as_sorceress(): Sorceress?

Returns Sorceress? (may be nil)

source

as_soundshot

function Entity.as_soundshot(): SoundShot?

Returns SoundShot? (may be nil)

source

as_spark

function Entity.as_spark(): Spark?

Returns Spark? (may be nil)

source

as_sparktrap

function Entity.as_sparktrap(): SparkTrap?

Returns SparkTrap? (may be nil)

source

as_spear

function Entity.as_spear(): Spear?

Returns Spear? (may be nil)

source

as_specialshot

function Entity.as_specialshot(): SpecialShot?

Returns SpecialShot? (may be nil)

source

as_spider

function Entity.as_spider(): Spider?

Returns Spider? (may be nil)

source

as_spikeballtrap

function Entity.as_spikeballtrap(): SpikeballTrap?

Returns SpikeballTrap? (may be nil)

source

as_splashbubblegenerator

function Entity.as_splashbubblegenerator(): SplashBubbleGenerator?

Returns SplashBubbleGenerator? (may be nil)

source

as_stickytrap

function Entity.as_stickytrap(): StickyTrap?

Returns StickyTrap? (may be nil)

source

as_stretchchain

function Entity.as_stretchchain(): StretchChain?

Returns StretchChain? (may be nil)

source

as_switch

function Entity.as_switch(): Switch?

Returns Switch? (may be nil)

source

as_tadpole

function Entity.as_tadpole(): Tadpole?

Returns Tadpole? (may be nil)

source

as_teleporter

function Entity.as_teleporter(): Teleporter?

Returns Teleporter? (may be nil)

source

as_teleporterbackpack

function Entity.as_teleporterbackpack(): TeleporterBackpack?

Returns TeleporterBackpack? (may be nil)

source

as_teleportingborder

function Entity.as_teleportingborder(): TeleportingBorder?

Returns TeleportingBorder? (may be nil)

source

as_telescope

function Entity.as_telescope(): Telescope?

Returns Telescope? (may be nil)

source

as_tentacle

function Entity.as_tentacle(): Tentacle?

Returns Tentacle? (may be nil)

source

as_tentaclebottom

function Entity.as_tentaclebottom(): TentacleBottom?

Returns TentacleBottom? (may be nil)

source

as_terra

function Entity.as_terra(): Terra?

Returns Terra? (may be nil)

source

as_thinice

function Entity.as_thinice(): ThinIce?

Returns ThinIce? (may be nil)

source

as_tiamat

function Entity.as_tiamat(): Tiamat?

Returns Tiamat? (may be nil)

source

as_tiamatshot

function Entity.as_tiamatshot(): TiamatShot?

Returns TiamatShot? (may be nil)

source

as_timedforcefield

function Entity.as_timedforcefield(): TimedForceField?

Returns TimedForceField? (may be nil)

source

as_timedpowderkeg

function Entity.as_timedpowderkeg(): TimedPowderkeg?

Returns TimedPowderkeg? (may be nil)

source

as_timedshot

function Entity.as_timedshot(): TimedShot?

Returns TimedShot? (may be nil)

source

as_torch

function Entity.as_torch(): Torch?

Returns Torch? (may be nil)

source

as_torchflame

function Entity.as_torchflame(): TorchFlame?

Returns TorchFlame? (may be nil)

source

as_totemtrap

function Entity.as_totemtrap(): TotemTrap?

Returns TotemTrap? (may be nil)

source

as_transferfloor

function Entity.as_transferfloor(): TransferFloor?

Returns TransferFloor? (may be nil)

source

as_trappart

function Entity.as_trappart(): TrapPart?

Returns TrapPart? (may be nil)

source

as_treasure

function Entity.as_treasure(): Treasure?

Returns Treasure? (may be nil)

source

as_treasurehook

function Entity.as_treasurehook(): TreasureHook?

Returns TreasureHook? (may be nil)

source

as_truecrownpowerup

function Entity.as_truecrownpowerup(): TrueCrownPowerup?

Returns TrueCrownPowerup? (may be nil)

source

as_tun

function Entity.as_tun(): Tun?

Returns Tun? (may be nil)

source

as_tv

function Entity.as_tv(): TV?

Returns TV? (may be nil)

source

as_udjatsocket

function Entity.as_udjatsocket(): UdjatSocket?

Returns UdjatSocket? (may be nil)

source

as_ufo

function Entity.as_ufo(): UFO?

Returns UFO? (may be nil)

source

as_unchainedspikeball

function Entity.as_unchainedspikeball(): UnchainedSpikeBall?

Returns UnchainedSpikeBall? (may be nil)

source

as_ushabti

function Entity.as_ushabti(): Ushabti?

Returns Ushabti? (may be nil)

source

as_vampire

function Entity.as_vampire(): Vampire?

Returns Vampire? (may be nil)

source

as_vanhorsing

function Entity.as_vanhorsing(): VanHorsing?

Returns VanHorsing? (may be nil)

source

as_vlad

function Entity.as_vlad(): Vlad?

Returns Vlad? (may be nil)

source

as_vladscape

function Entity.as_vladscape(): VladsCape?

Returns VladsCape? (may be nil)

source

as_waddler

function Entity.as_waddler(): Waddler?

Returns Waddler? (may be nil)

source

as_walkingmonster

function Entity.as_walkingmonster(): WalkingMonster?

Returns WalkingMonster? (may be nil)

source

as_walltorch

function Entity.as_walltorch(): WallTorch?

Returns WallTorch? (may be nil)

source

as_web

function Entity.as_web(): Web?

Returns Web? (may be nil)

source

as_webgun

function Entity.as_webgun(): WebGun?

Returns WebGun? (may be nil)

source

as_webshot

function Entity.as_webshot(): WebShot?

Returns WebShot? (may be nil)

source

as_weteffect

function Entity.as_weteffect(): WetEffect?

Returns WetEffect? (may be nil)

source

as_whip

function Entity.as_whip(): Whip?

Returns Whip? (may be nil)

source

as_witchdoctor

function Entity.as_witchdoctor(): WitchDoctor?

Returns WitchDoctor? (may be nil)

source

as_witchdoctorskull

function Entity.as_witchdoctorskull(): WitchDoctorSkull?

Returns WitchDoctorSkull? (may be nil)

source

as_woodenlogtrap

function Entity.as_woodenlogtrap(): WoodenlogTrap?

Returns WoodenlogTrap? (may be nil)

source

as_yama

function Entity.as_yama(): Yama?

Returns Yama? (may be nil)

source

as_yang

function Entity.as_yang(): Yang?

Returns Yang? (may be nil)

source

as_yellowcape

function Entity.as_yellowcape(): YellowCape?

Returns YellowCape? (may be nil)

source

as_yetiking

function Entity.as_yetiking(): YetiKing?

Returns YetiKing? (may be nil)

source

as_yetiqueen

function Entity.as_yetiqueen(): YetiQueen?

Returns YetiQueen? (may be nil)

source

attach

function Entity:attach(new_overlay?: Entity)
new_overlay?: Entityoptional
source

can_be_pushed

function Entity:can_be_pushed(): boolean

Returns boolean

source

clear_virtual

function Entity:clear_virtual(callback_id: integer)
callback_id: integer
source

destroy

function Entity:destroy()
source

destroy_recursive

function Entity:destroy_recursive()
function Entity:destroy_recursive(mask: MASK?, ent_types: ENT_TYPE[], rec_mode: RECURSIVE_MODE)
mask: MASK?
ent_types: ENT_TYPE[]
rec_mode: RECURSIVE_MODE
source

detach

function Entity:detach(check_autokill?: boolean)
check_autokill?: booleanoptional
source

flip

function Entity:flip(left: boolean)
left: boolean
source

friction

function Entity:friction(): number

Returns number

source

get_absolute_position

function Entity:get_absolute_position(): Vec2

Returns Vec2

source

get_absolute_velocity

function Entity:get_absolute_velocity(): Vec2

Returns Vec2

source

get_held_entity

function Entity:get_held_entity(): Entity?

Returns Entity? (may be nil)

source

get_hitbox

function Entity:get_hitbox(use_render_pos?: boolean): AABB
use_render_pos?: booleanoptional

Returns AABB

source

get_items

function Entity:get_items(): integer[]

Returns integer[]

source

get_metadata

function Entity:get_metadata(): integer

Returns integer

source

get_texture

function Entity:get_texture(): TEXTURE

Returns TEXTURE

source

is_cursed

function Entity:is_cursed(): boolean

Returns boolean

source

is_in_liquid

function Entity:is_in_liquid(): boolean

Returns boolean

source

is_movable

function Entity:is_movable(): boolean

Returns boolean

source

kill

function Entity:kill(destroy_corpse: boolean, responsible?: Entity)
destroy_corpse: boolean
responsible?: Entityoptional
source

kill_recursive

function Entity:kill_recursive(destroy_corpse: boolean, responsible?: Entity)
destroy_corpse: boolean
responsible?: Entityoptional
function Entity:kill_recursive(destroy_corpse: boolean, responsible: Entity?, mask: MASK?, ent_types: ENT_TYPE[], rec_mode: RECURSIVE_MODE)
destroy_corpse: boolean
responsible: Entity?
mask: MASK?
ent_types: ENT_TYPE[]
rec_mode: RECURSIVE_MODE
source

liberate_from_shop

function Entity:liberate_from_shop(clear_parent: boolean)
clear_parent: boolean
function Entity:liberate_from_shop()
source

overlaps_with

function Entity:overlaps_with(other?: Entity): boolean
other?: Entityoptional

Returns boolean

function Entity:overlaps_with(hitbox: AABB): boolean
hitbox: AABB

Returns boolean

function Entity:overlaps_with(rect_left: number, rect_bottom: number, rect_right: number, rect_top: number): boolean
rect_left: number
rect_bottom: number
rect_right: number
rect_top: number

Returns boolean

source

perform_teleport

function Entity:perform_teleport(delta_x: integer, delta_y: integer)
delta_x: integer
delta_y: integer
source

remove

function Entity:remove()
source

remove_item

function Entity:remove_item(entity: Entity?, autokill_check: boolean)
entity: Entity?
autokill_check: boolean
source

reset_draw_depth

function Entity:reset_draw_depth()
source

respawn

function Entity:respawn(layer_to: LAYER)
layer_to: LAYER
source

set_draw_depth

function Entity:set_draw_depth(draw_depth: integer, unknown?: integer)
draw_depth: integer
unknown?: integeroptional

optional unknown - game usually sets it to 0, doesn't appear to have any special effect (needs more reverse engineering)

source

set_enable_turning

function Entity:set_enable_turning(enabled: boolean)
enabled: boolean
source

set_invisible

function Entity:set_invisible(value: boolean)
value: boolean
source

set_layer

function Entity:set_layer(layer: LAYER)
layer: LAYER
source

set_post_activate

function Entity:set_post_activate(fun: fun(self: Entity?, activator: Entity?)): integer
fun: fun(self: Entity?, activator: Entity?)

Returns integer

Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... get_entity(<udjat socket uid>):activate(players[1]) (make sure player 1 has the udjat eye though)

source

set_post_apply_metadata

function Entity:set_post_apply_metadata(fun: fun(self: Entity?, metadata: integer)): integer
fun: fun(self: Entity?, metadata: integer)

Returns integer

source

set_post_can_be_pushed

function Entity:set_post_can_be_pushed(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_create_rendering_info

function Entity:set_post_create_rendering_info(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_destroy

function Entity:set_post_destroy(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Completely removes the entity from existence

source

set_post_dtor

function Entity:set_post_dtor(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_flip

function Entity:set_post_flip(fun: fun(self: Entity?, left: boolean)): integer
fun: fun(self: Entity?, left: boolean)

Returns integer

source

set_post_friction

function Entity:set_post_friction(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Friction of this entity, affects it's contact with other entities (how fast it slows down on the floor, how fast it can move but also the other way around for floors/activefloors: how other entities can move on it)

source

set_post_generate_damage_particles

function Entity:set_post_generate_damage_particles(fun: fun(self: Entity?, victim: Entity?, damage: integer, killing: boolean)): integer
fun: fun(self: Entity?, victim: Entity?, damage: integer, killing: boolean)

Returns integer

source

set_post_get_held_entity

function Entity:set_post_get_held_entity(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_get_metadata

function Entity:set_post_get_metadata(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred)

source

set_post_init

function Entity:set_post_init(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Applies changes made in entity.type

source

set_post_is_in_liquid

function Entity:set_post_is_in_liquid(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Returns true if entity is in water/lava

source

set_post_kill

function Entity:set_post_kill(fun: fun(self: Entity?, destroy_corpse: boolean, responsible: Entity?)): integer
fun: fun(self: Entity?, destroy_corpse: boolean, responsible: Entity?)

Returns integer

Kills the entity, you can set responsible to nil to ignore it

source

set_post_ledge_grab

function Entity:set_post_ledge_grab(fun: fun(self: Entity?, who: Entity?)): integer
fun: fun(self: Entity?, who: Entity?)

Returns integer

source

set_post_liberate_from_shop

function Entity:set_post_liberate_from_shop(fun: fun(self: Entity?, clear_parent: boolean)): integer
fun: fun(self: Entity?, clear_parent: boolean)

Returns integer

It's not called when item is bought. It does not remove the item from StateMemory.room_owners.owned_items Parameter clear_parent used only for CHAR_* entities, sets the linked_companion_parent to -1.

source

set_post_on_collision1

function Entity:set_post_on_collision1(fun: fun(self: Entity?, other_entity: Entity?)): integer
fun: fun(self: Entity?, other_entity: Entity?)

Returns integer

Collisions with stuff that blocks you, like walls, floors, etc. Triggers for entities in it's EntityDB.collision_mask

source

set_post_on_collision2

function Entity:set_post_on_collision2(fun: fun(self: Entity?, other_entity: Entity?)): integer
fun: fun(self: Entity?, other_entity: Entity?)

Returns integer

More like on_overlap, triggers when entities touch/overlap each other. Triggers for entities in it's EntityDB.collision2_mask

source

set_post_remove_item

function Entity:set_post_remove_item(fun: fun(self: Entity?, entity: Entity?, autokill_check: boolean)): integer
fun: fun(self: Entity?, entity: Entity?, autokill_check: boolean)

Returns integer

Can be called multiple times for the same entity (for example when play throws/drops entity from it's hands)

source

set_post_reset_draw_depth

function Entity:set_post_reset_draw_depth(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_set_as_sound_source

function Entity:set_post_set_as_sound_source(fun: fun(self: Entity?, p2: SoundMeta?)): integer
fun: fun(self: Entity?, p2: SoundMeta?)

Returns integer

source

set_post_set_draw_depth

function Entity:set_post_set_draw_depth(fun: fun(self: Entity?, draw_depth: integer, b3f: integer)): integer
fun: fun(self: Entity?, draw_depth: integer, b3f: integer)

Returns integer

source

set_post_set_invisible

function Entity:set_post_set_invisible(fun: fun(self: Entity?, value: boolean)): integer
fun: fun(self: Entity?, value: boolean)

Returns integer

source

set_post_stood_on

function Entity:set_post_stood_on(fun: fun(self: Entity?, entity: Entity?, p3: Vec2?)): integer
fun: fun(self: Entity?, entity: Entity?, p3: Vec2?)

Returns integer

source

set_post_trigger_action

function Entity:set_post_trigger_action(fun: fun(self: Entity?, user: Entity?)): integer
fun: fun(self: Entity?, user: Entity?)

Returns integer

Triggers weapons and other held items like teleporter, mattock etc. You can check the virtual-availability.md, if entity has open in the on_open you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou)

source

set_post_update_state_machine

function Entity:set_post_update_state_machine(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_virtual

function Entity:set_post_virtual(index: integer, fun: function): integer?
index: integer
fun: function
Callback signature not known from the code.

Returns integer? (may be nil)

source

set_post_walked_off

function Entity:set_post_walked_off(fun: fun(self: Entity?, walker: Entity?)): integer
fun: fun(self: Entity?, walker: Entity?)

Returns integer

source

set_post_walked_on

function Entity:set_post_walked_on(fun: fun(self: Entity?, walker: Entity?)): integer
fun: fun(self: Entity?, walker: Entity?)

Returns integer

source

set_pre_activate

function Entity:set_pre_activate(fun: fun(self: Entity?, activator: Entity?): boolean): integer
fun: fun(self: Entity?, activator: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... get_entity(<udjat socket uid>):activate(players[1]) (make sure player 1 has the udjat eye though)

source

set_pre_apply_metadata

function Entity:set_pre_apply_metadata(fun: fun(self: Entity?, metadata: integer): boolean): integer
fun: fun(self: Entity?, metadata: integer): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_can_be_pushed

function Entity:set_pre_can_be_pushed(fun: fun(self: Entity?): boolean?): integer
fun: fun(self: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_create_rendering_info

function Entity:set_pre_create_rendering_info(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_destroy

function Entity:set_pre_destroy(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Completely removes the entity from existence

source

set_pre_dtor

function Entity:set_pre_dtor(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_flip

function Entity:set_pre_flip(fun: fun(self: Entity?, left: boolean): boolean): integer
fun: fun(self: Entity?, left: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_friction

function Entity:set_pre_friction(fun: fun(self: Entity?): number?): integer
fun: fun(self: Entity?): number?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Friction of this entity, affects it's contact with other entities (how fast it slows down on the floor, how fast it can move but also the other way around for floors/activefloors: how other entities can move on it)

source

set_pre_generate_damage_particles

function Entity:set_pre_generate_damage_particles(fun: fun(self: Entity?, victim: Entity?, damage: integer, killing: boolean): boolean): integer
fun: fun(self: Entity?, victim: Entity?, damage: integer, killing: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_get_held_entity

function Entity:set_pre_get_held_entity(fun: fun(self: Entity?): Entity?): integer
fun: fun(self: Entity?): Entity?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_get_metadata

function Entity:set_pre_get_metadata(fun: fun(self: Entity?): integer?): integer
fun: fun(self: Entity?): integer?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred)

source

set_pre_init

function Entity:set_pre_init(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Applies changes made in entity.type

source

set_pre_is_in_liquid

function Entity:set_pre_is_in_liquid(fun: fun(self: Entity?): boolean?): integer
fun: fun(self: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Returns true if entity is in water/lava

source

set_pre_kill

function Entity:set_pre_kill(fun: fun(self: Entity?, destroy_corpse: boolean, responsible: Entity?): boolean): integer
fun: fun(self: Entity?, destroy_corpse: boolean, responsible: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Kills the entity, you can set responsible to nil to ignore it

source

set_pre_ledge_grab

function Entity:set_pre_ledge_grab(fun: fun(self: Entity?, who: Entity?): boolean): integer
fun: fun(self: Entity?, who: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_liberate_from_shop

function Entity:set_pre_liberate_from_shop(fun: fun(self: Entity?, clear_parent: boolean): boolean): integer
fun: fun(self: Entity?, clear_parent: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

It's not called when item is bought. It does not remove the item from StateMemory.room_owners.owned_items Parameter clear_parent used only for CHAR_* entities, sets the linked_companion_parent to -1.

source

set_pre_on_collision1

function Entity:set_pre_on_collision1(fun: fun(self: Entity?, other_entity: Entity?): boolean): integer
fun: fun(self: Entity?, other_entity: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Collisions with stuff that blocks you, like walls, floors, etc. Triggers for entities in it's EntityDB.collision_mask

source

set_pre_on_collision2

function Entity:set_pre_on_collision2(fun: fun(self: Entity?, other_entity: Entity?): boolean): integer
fun: fun(self: Entity?, other_entity: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

More like on_overlap, triggers when entities touch/overlap each other. Triggers for entities in it's EntityDB.collision2_mask

source

set_pre_remove_item

function Entity:set_pre_remove_item(fun: fun(self: Entity?, entity: Entity?, autokill_check: boolean): boolean): integer
fun: fun(self: Entity?, entity: Entity?, autokill_check: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Can be called multiple times for the same entity (for example when play throws/drops entity from it's hands)

source

set_pre_reset_draw_depth

function Entity:set_pre_reset_draw_depth(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_set_as_sound_source

function Entity:set_pre_set_as_sound_source(fun: fun(self: Entity?, p2: SoundMeta?): boolean): integer
fun: fun(self: Entity?, p2: SoundMeta?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_set_draw_depth

function Entity:set_pre_set_draw_depth(fun: fun(self: Entity?, draw_depth: integer, b3f: integer): boolean): integer
fun: fun(self: Entity?, draw_depth: integer, b3f: integer): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_set_invisible

function Entity:set_pre_set_invisible(fun: fun(self: Entity?, value: boolean): boolean): integer
fun: fun(self: Entity?, value: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_stood_on

function Entity:set_pre_stood_on(fun: fun(self: Entity?, entity: Entity?, p3: Vec2?): boolean): integer
fun: fun(self: Entity?, entity: Entity?, p3: Vec2?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_trigger_action

function Entity:set_pre_trigger_action(fun: fun(self: Entity?, user: Entity?): boolean?): integer
fun: fun(self: Entity?, user: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Triggers weapons and other held items like teleporter, mattock etc. You can check the virtual-availability.md, if entity has open in the on_open you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou)

source

set_pre_update_state_machine

function Entity:set_pre_update_state_machine(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_virtual

function Entity:set_pre_virtual(index: integer, fun: function): integer?
index: integer
fun: function
Callback signature not known from the code.

Returns integer? (may be nil)

source

set_pre_walked_off

function Entity:set_pre_walked_off(fun: fun(self: Entity?, walker: Entity?): boolean): integer
fun: fun(self: Entity?, walker: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_walked_on

function Entity:set_pre_walked_on(fun: fun(self: Entity?, walker: Entity?): boolean): integer
fun: fun(self: Entity?, walker: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_texture

function Entity:set_texture(texture_id: TEXTURE): boolean
texture_id: TEXTURE

Returns boolean

source

topmost

function Entity:topmost(): any

Returns any

Returns the top entity in a chain (overlay)

source

topmost_mount

function Entity:topmost_mount(): any

Returns any

source

trigger_action

function Entity:trigger_action(user?: Entity): boolean
user?: Entityoptional

Returns boolean

source

update

function Entity:update()
source