# Data Type DataType

Can be called directly without creating new object, the form of call as below:

local errorCode = ErrorCode.OK
local worldType = WorldType.OWTYPE_GAMEMAKER

The use and descriptions of Lua Native Data and other Global Data

# Lua Native Data

Data Name Description
nil an invalid value(equivalent to false in a conditional expression)
boolean Boolean value,including 2 value:false and true
number Real Numbers, represent double floating point, also can be round number
string Character string, represented by a pair of single or double quotation marks
table A data structure in Lua that can be used to create different data types, such as arrays, dictionaries, etc
function Functions written by C or Lua
userdata Represents any C data structure stored in a variable
thread Represents a separate line of execution for executing coroutines

# Error Code

Name Value Description
ErrorCode.OK 0 correct return
ErrorCode.FAILED 1001 error return

# Inventory Initial Position

Name Value Description
BPACK_SINDEX.BACKPACK_START_INDEX 0 Backpack bar
BPACK_SINDEX.SHORTCUT_START_INDEX 1000 Shortcut bar
BPACK_SINDEX.STORAGE_START_INDEX 3000 Storage box
BPACK_SINDEX.EQUIP_START_INDEX 8000 Armor bar

# Game Mode

Name Value Description
WorldType.OWTYPE_SINGLE 0 Single mode
WorldType.OWTYPE_CREATE 1 Multiplayer creation mode
WorldType.OWTYPE_EXTREMITY 2 Extreme mode
WorldType.OWTYPE_CREATE_RUNGAME 3 Survival mode switched from creation mode
WorldType.OWTYPE_GAMEMAKER 4 Dev mode-edit
WorldType.OWTYPE_GAMEMAKER_RUN 5 Dev mode-play
WorldType.OWTYPE_FREEMODE 6 Survival mode-free
WorldType.OWTYPE_RECORD 9 Record mode

# Game Terrian

Name Value Description
TerrainType.TERRAIN_FLAT 0 Flat terrian
TerrainType.TERRAIN_NORMAL 1 Random Terrian

# Custom View Edit State

Name Value Description
CameraEditState.CAMERA_EDIT_STATE_NULL 0 Empty
CameraEditState.CAMERA_EDIT_STATE_EDIT 1 Edit
CameraEditState.CAMERA_EDIT_STATE_TEST 2 Test

# Mini-map Mark

Name Value Description
MAPMARK_TYPE.MMARK_LINE 0 Linear mark
MAPMARK_TYPE.MMARK_RECTANGLE 1 Rectangular mark
MAPMARK_TYPE.MMARK_CIRCLE 2 Circular mark

# Equipment Parts

Name Value Description
EQUIP_SLOT_TYPE.EQUIP_HEAD 0 Head
EQUIP_SLOT_TYPE.EQUIP_BREAST 1 Chest
EQUIP_SLOT_TYPE.EQUIP_LEGGING 2 Leg
EQUIP_SLOT_TYPE.EQUIP_SHOE 3 foot
EQUIP_SLOT_TYPE.EQUIP_PIFENG 4 Cloak
EQUIP_SLOT_TYPE.EQUIP_WEAPON 5 Weapon
EQUIP_SLOT_TYPE.MAX_EQUIP_SLOTS 6 ---

# Enchant Attributes

Name Value Description
MODATTRIB_TYPE.MODATTR_MOVE_SPEED 0 Walking speed
MODATTRIB_TYPE.MODATTR_SWIM_SPEED 1 Swimming speed
MODATTRIB_TYPE.MODATTR_JUMP_SPEED 2 Upward jumping speed
MODATTRIB_TYPE.MODATTR_ATTACK_PUNCH 3 Percentage of melee attack buff
MODATTRIB_TYPE.MODATTR_ATTACK_RANGE 4 Percentage of ranged attack buff
MODATTRIB_TYPE.MODATTR_ATTACK_EXPLODE 5 Percentage of explosion attack buff
MODATTRIB_TYPE.MODATTR_ATTACK_FIRE 6 Percentage of fire attack buff
MODATTRIB_TYPE.MODATTR_ATTACK_POISON 7 Percentage of poison attack buff
MODATTRIB_TYPE.MODATTR_ATTACK_WITHER 8 Percentage of wither attack buff
MODATTRIB_TYPE.MODATTR_ATTACK_PLAYER 9 Bonus percentage when attack other players
MODATTRIB_TYPE.MODATTR_ATTACK_UNDEAD 10 Bonus percentage when attack the undead
MODATTRIB_TYPE.MODATTR_ATTACK_ANIMAL 11 Bonus percentage when attack animals
MODATTRIB_TYPE.MODATTR_DAMAGED_PUNCH 12 Percentage of melee attack buff when being attacked
MODATTRIB_TYPE.MODATTR_DAMAGED_RANGE 13 Percentage of ranged attack buff when being attacked
MODATTRIB_TYPE.MODATTR_DAMAGED_EXPLODE 14 Percentage of explosion attack buff when being attacked by explosion
MODATTRIB_TYPE.MODATTR_DAMAGED_FIRE 15 Percentage of fire attack buff when being attacked by fire
MODATTRIB_TYPE.MODATTR_DAMAGED_POISON 16 Percentage of poison attack when being attacked by poison
MODATTRIB_TYPE.MODATTR_DAMAGED_WITHER 17 Percentage of wither attack buff when being attacked
MODATTRIB_TYPE.MODATTR_DAMAGED_FALLING 18 Percentage of fall damage when falling from high place
MODATTRIB_TYPE.MODATTR_ARMOR_PUNCH 19 Melee armor defense increase
MODATTRIB_TYPE.MODATTR_ARMOR_RANGE 20 Ranged armor defense increase
MODATTRIB_TYPE.MODATTR_ARMOR_EXPLODE 21 Blast armor defense increase
MODATTRIB_TYPE.MODATTR_DAMAGE_ABSORB 22 Damage absorption
MODATTRIB_TYPE.MODATTR_CRITICAL_HIT 23 Percentage of critical hit buff
MODATTRIB_TYPE.MODATTR_KNOCK 24 Increase knockback distance when attacking others
MODATTRIB_TYPE.MODATTR_KNOCK_RESIST 25 Reduce knockback distance
MODATTRIB_TYPE.MODATTR_KNOCK_RESIST_PROB 26 Knockback resistance,0.2 means there's a 20% chance of not being knockback
MODATTRIB_TYPE.MODATTR_DIG_SPEED 27 Mining speed
MODATTRIB_TYPE.MODATTR_LUCK_DIG 28 Mining fortune,0.2 mean 20% chance of more block drops
MODATTRIB_TYPE.MODATTR_LUCK_KILLMOB 29 Monster loot
MODATTRIB_TYPE.MODATTR_VIEW_BRIGHT 30 Vision brightness 0 - 1.0
MODATTRIB_TYPE.MODATTR_ACTOR_SCALE 31 Character Size 0 - 1.0
MODATTRIB_TYPE.MODATTR_OXYGEN_SUPPLY 32 Oxygen supply 1: only underwater,100:Only in planet Horas, 101:Both10000:RecoverOxygen
MODATTRIB_TYPE.MAX_MOB_MODATTR 27 ---
MODATTRIB_TYPE.MAX_PLAYER_MODATTR 33 ---
MODATTRIB_TYPE.MAX_MOD_ATTRIB 33 ---

# Game Result

Name Value Description
TEAM_RESULTS.TEAM_RESULTS_NONE 0 Unsettled
TEAM_RESULTS.TEAM_RESULTS_WIN 1 Victory
TEAM_RESULTS.TEAM_RESULTS_LOSE 2 Defeated
TEAM_RESULTS.TEAM_RESULTS_DOGFALL 3 Draw

# Game Sound Type

Name Value Description
GSOUND_TYPE.GSOUND_DIG 0 Mining
GSOUND_TYPE.GSOUND_DESTROY 1 Breaking
GSOUND_TYPE.GSOUND_PLACE 2 Placing
GSOUND_TYPE.GSOUND_FALLGROUND 3 Falling down
GSOUND_TYPE.GSOUND_WALK 4 Walk

# Creature Body Effect

Name Value Description
ACTORBODY_EFFECT.BODYFX_HURT 0 ---
ACTORBODY_EFFECT.BODYFX_FIRE 1 ---
ACTORBODY_EFFECT.BODYFX_PORTAL 2 ---
ACTORBODY_EFFECT.BODYFX_ACCUMFIRE 3 ---
ACTORBODY_EFFECT.BODYFX_DRAGONFIRE 4 ---
ACTORBODY_EFFECT.BODYFX_DRAGONSUMMON 5 ---
ACTORBODY_EFFECT.BODYFX_TAME_SUCCEED 6 ---
ACTORBODY_EFFECT.BODYFX_TAME_FAILED 7 ---
ACTORBODY_EFFECT.BODYFX_TAME_FOOD 8 ---
ACTORBODY_EFFECT.BODYFX_TAME_NOFOOD 9 ---
ACTORBODY_EFFECT.BODYFX_AI_NEEDREEDS 10 ---
ACTORBODY_EFFECT.BODYFX_FEAR 11 ---
ACTORBODY_EFFECT.BODYFX_ROLECOLLECT 12 ---
ACTORBODY_EFFECT.BODYFX_ROLEJUMP 13 ---
ACTORBODY_EFFECT.BODYFX_DEADPROTECT 14 ---
ACTORBODY_EFFECT.BODYFX_DRAGONDIE0 15 ---
ACTORBODY_EFFECT.BODYFX_DRAGONDIE1 16 ---
ACTORBODY_EFFECT.BODYFX_DRAGONDIE2 17 ---
ACTORBODY_EFFECT.BODYFX_HORSE_FLY 18 ---
ACTORBODY_EFFECT.BODYFX_DISAPPEAR 19 ---
ACTORBODY_EFFECT.BODYFX_HORSE_BENTENG 20 ---
ACTORBODY_EFFECT.BODYFX_DANCE 21 ---
ACTORBODY_EFFECT.TOOLFX_JETPACK2 22 ---
ACTORBODY_EFFECT.BODYFX_INTERACTION 23 ---
ACTORBODY_EFFECT.HUDFX_HEADSHOT 24 ---
ACTORBODY_EFFECT.HUDFX_NORMALSHOT 25 ---
ACTORBODY_EFFECT.BODYFX_MILKING 26 ---
ACTORBODY_EFFECT.BODYFX_AI_ANGRY 27 ---
ACTORBODY_EFFECT.BODYFX_AI_SLEEP 28 ---
ACTORBODY_EFFECT.BODYFX_TRANSPORT 29 ---
ACTORBODY_EFFECT.BODYFX_FORBIDDEN 30 ---
ACTORBODY_EFFECT.BODYFX_CONCEAL 31 Sneak
ACTORBODY_EFFECT.BODYFX_WEAPON_FIRE 32 Spear Goblin's weapon fire effect
ACTORBODY_EFFECT.BODYFX_DIZZY 33 dizziness
ACTORBODY_EFFECT.BODYFX_MAKETROUBLE 34 ---
ACTORBODY_EFFECT.BODYFX_TRAINMOVE 35 Train moving effect
ACTORBODY_EFFECT.BODYFX_AI_HUNGRY 36 Hungry
ACTORBODY_EFFECT.BODYFX_BALL_CHARGE 37 Power accumulate effect when kicking ball
ACTORBODY_EFFECT.BODYFX_BALL_SHOOT_RELEASE 38 Break out effect when shooting ball
ACTORBODY_EFFECT.BODYFX_ENCH_FALL 39 Enchant downhill

# Object Type

Name Value Description
OBJ_TYPE.OBJTYPE_PLAYER 1 Players
OBJ_TYPE.OBJTYPE_CREATURE 2 Creatures(including mobs, animals, NPC and etc.)
OBJ_TYPE.OBJTYPE_DROPITEM 3 Item drops
OBJ_TYPE.OBJTYPE_MISSILE 4 Projectiles

# Player Backpack Type

Name Value Description
BACKPACK_TYPE.SHORTCUT 1 Shortcut bar
BACKPACK_TYPE.INVENTORY 2 Inventory bar
BACKPACK_TYPE.EQUIP 3 Armor bar

# Player Face Direction

Name Value Description
FACE_DIRECTION.DIR_NOT_INIT -1 Unassigned
FACE_DIRECTION.DIR_NEG_X 0 X negative direction
FACE_DIRECTION.DIR_POS_X 1 X positive direction
FACE_DIRECTION.DIR_NEG_Z 2 Z negative direction
FACE_DIRECTION.DIR_POS_Z 3 Z positive direction
FACE_DIRECTION.DIR_NEG_Y 4 Y negative direction
FACE_DIRECTION.DIR_POS_Y 5 Y positive direction

# Creature Attributes

Name Value Description
CREATUREATTR.MAX_HP 1 Max health point
CREATUREATTR.CUR_HP 2 Current health point
CREATUREATTR.HP_RECOVER 3 Health point recover
CREATUREATTR.MAX_HUNGER 5 Max hunger point
CREATUREATTR.CUR_HUNGER 6 Current hunger point
CREATUREATTR.MAX_OXYGEN 7 Max oxygen point
CREATUREATTR.CUR_OXYGEN 8 Current oxygen point
CREATUREATTR.RECOVER_OXYGEN 9 Speed of oxygen recovery
CREATUREATTR.WALK_SPEED 10 Walking speed
CREATUREATTR.RUN_SPEED 11 Running speed
CREATUREATTR.SWIN_SPEED 13 Swimming speed
CREATUREATTR.JUMP_POWER 14 Jumping force
CREATUREATTR.WEIGHT 15 Weight
CREATUREATTR.DODGE 16 Dodge rate
CREATUREATTR.ATK_MELEE 17 Melee attack
CREATUREATTR.ATK_REMOTE 18 Ranged attack
CREATUREATTR.DEF_MELEE 19 Melee defense
CREATUREATTR.DEF_REMOTE 20 Ranged defense
CREATUREATTR.DIMENSION 21 Model Size

# Creature Attributes Setup

Name Value Description
CREATUREATTR.ENABLE_MOVE 1 Can move
CREATUREATTR.ENABLE_ATTACK 32 Can attack
CREATUREATTR.ENABLE_BEATTACKED 64 Can be attacked
CREATUREATTR.ENABLE_BEKILLED 128 Can be killed
CREATUREATTR.ENABLE_PICKUP 256 Can pick up items
CREATUREATTR.ENABLE_DEATHDROPITEM 512 Drop items when die

# Creature Motions

Name Value Description
CREATUREMOTION.IDLE 1 Idle
CREATUREMOTION.STANDBY 2 Standby
CREATUREMOTION.STROLL 3 Stroll
CREATUREMOTION.ATK_MELEE 4 Melee attack
CREATUREMOTION.ATK_REMOTE 5 Ranged attack
CREATUREMOTION.FOLLOW 6 Follow
CREATUREMOTION.SWIM 7 Swim
CREATUREMOTION.RUN_AWAY 8 Runaway
CREATUREMOTION.SELF_BOMB 9 Self explosion
CREATUREMOTION.BEATTRACTED 10 Attracted
CREATUREMOTION.COPULATION 11 Mate

# Player Attributes

Name Value Description
PLAYERATTR.MAX_HP 1 Max health point
PLAYERATTR.CUR_HP 2 Current health point
PLAYERATTR.HP_RECOVER 3 Health point recover
PLAYERATTR.LIFE_NUM 4 Number of life
PLAYERATTR.MAX_HUNGER 5 Max hunger point
PLAYERATTR.CUR_HUNGER 6 Current hunger point
PLAYERATTR.MAX_OXYGEN 7 Max oxygen point
PLAYERATTR.CUR_OXYGEN 8 Current oxygen point
PLAYERATTR.RECOVER_OXYGEN 9 Speed of oxygen recovery
PLAYERATTR.WALK_SPEED 10 Walking speed
PLAYERATTR.RUN_SPEED 11 Running speed
PLAYERATTR.SNEAK_SPEED 12 Sneaking speed
PLAYERATTR.SWIN_SPEED 13 Swimming speed
PLAYERATTR.JUMP_POWER 14 Jumping force
PLAYERATTR.DODGE 16 Dodge rate
PLAYERATTR.ATK_MELEE 17 Melee attack
PLAYERATTR.ATK_REMOTE 18 Ranged attack
PLAYERATTR.DEF_MELEE 19 Melee defense
PLAYERATTR.DEF_REMOTE 20 Ranged defense
PLAYERATTR.DIMENSION 21 Model Size
PLAYERATTR.SCORE 22 Score
PLAYERATTR.LEVEL 23 Level

# Player Attributes Setup

Name Value Description
PLAYERATTR.ENABLE_MOVE 1 Can move
PLAYERATTR.ENABLE_PLACEBLOCK 2 Can place blocks
PLAYERATTR.ENABLE_OPERATEBLOCK 4 Can use blocks
PLAYERATTR.ENABLE_DESTROYBLOCK 8 Can break blocks
PLAYERATTR.ENABLE_USEITEM 16 Can use items
PLAYERATTR.ENABLE_ATTACK 32 Can attack
PLAYERATTR.ENABLE_BEATTACKED 64 Can be attacked
PLAYERATTR.ENABLE_BEKILLED 128 Can be killed
PLAYERATTR.ENABLE_PICKUP 256 Can pick up items
PLAYERATTR.ENABLE_DEATHDROPITEM 512 Drop items when die
PLAYERATTR.ENABLE_VEHICLEAUTOFORWARD 1024 Vehicle Automatic Pilot
PLAYERATTR.ENABLE_DISCARDITEM 2048 Can discard items

# Player Items Setup

Name Value Description
PLAYERATTR.ITEM_DISABLE_THROW 1 Cannot discard items
PLAYERATTR.ITEM_DISABLE_DROP 2 Cannot drop items

# Player Motions

Name Value Description
PLAYERMOTION.STATIC 0 Stay still
PLAYERMOTION.WALK 1 Walk
PLAYERMOTION.RUN 2 Run
PLAYERMOTION.JUMP 4 Jump
PLAYERMOTION.JUMP_TWICE 8 Double jump
PLAYERMOTION.SNEAK 16 Sneak
PLAYERMOTION.FALL_GROUND 32 fall to the ground
PLAYERMOTION.TURNBACK 1000000 Cancelled
PLAYERMOTION.UP 1000001 Cancelled
PLAYERMOTION.DOWN 1000002 Cancelled
PLAYERMOTION.FALL 1000003 Cancelled

# Team Attributes

Name Value Description
TEAMATTR.PLAYER_NUM 1 Number of players
TEAMATTR.SCORE 2 Score

# Damage Type

Name Value Description
HURTTYPE.MELEE 0 Melee damage ATTACK_PUNCH
HURTTYPE.REMOTE 1 Ranged damege ATTACK_RANGE
HURTTYPE.BOMB 2 Blast damage ATTACK_EXPLODE
HURTTYPE.PHYSICS 3 Physical damage MAX_PHYSICS_ATTACK
HURTTYPE.BURNING 3 Burning damage ATTACK_FIRE
HURTTYPE.TOXIN 4 Poison damage ATTACK_POISON
HURTTYPE.WITHER 5 Wither damage ATTACK_WITHER
HURTTYPE.MAGIC 6 Elemental Damage MAX_MAGIC_ATTACK
HURTTYPE.SUN 6 Sunburn damage ATTACK_SUN
HURTTYPE.FALL 7 Falling damage ATTACK_FALLING
HURTTYPE.ANVIL 8 Smash damage ATTACK_ANVIL
HURTTYPE.CACTUS 9 Cactus damage ATTACK_CACTUS
HURTTYPE.ASPHYXIA 10 Suffocation ATTACK_WALL
HURTTYPE.DROWN 11 Drowning ATTACK_DROWN
HURTTYPE.SUFFOCATE 12 Suffocation of Underwater creatures on land ATTACK_SUFFOCATE
HURTTYPE.ANTIINJURY 13 Thorn damage ATTACK_ANTIINJURY
HURTTYPE.LASER 14 Laser damage ATTACK_BLOCK_LASER

# Special Block Type

Name Value Description
BLOCKID.AIR 0 Air

# Block Attributes

Name Value Description
BLOCKATTR.EXPLODE_RESISTANCE 1 Explosion resistance
BLOCKATTR.HARDNESS 2 Rigidity
BLOCKATTR.GLISSADE 3 Slide Inertia
BLOCKATTR.BURNING_SPEED 4 Burning speed
BLOCKATTR.BURNING_PROBABILITY 5 Burning rate
BLOCKATTR.LIGHTNESS 6 Brightness

# Block Attributes Setup

Name Value Description
BLOCKATTR.ENABLE_DESTROYED 1 Destructible
BLOCKATTR.ENABLE_BEOPERATED 2 Can be used
BLOCKATTR.ENABLE_BEPUSHED 4 Can be pushed
BLOCKATTR.ENABLE_DROPITEM 8 Can drop items
BLOCKATTR.BEPUSHED_DROPITEM 16 Can be pushed and drop items

# Block Status

Name Value Description
BLOCKSTATUS.ACTIVE 1 Active(Activated)
BLOCKSTATUS.INACTIVE 2 Inactive(unactivated)

# Weather Conditions

Name Value Description
WEATHERSTATUS.SHINE_AND_RAIN 0 Rainy or sunny
WEATHERSTATUS.SHINE 1 Sunny
WEATHERSTATUS.RAIN 2 Rainy

# Viewport Direction

Name Value Description
VIEWPORTTYPE.MAINVIEW 0 First Person View
VIEWPORTTYPE.BACKVIEW 1 3rd-Person View
VIEWPORTTYPE.FRONTVIEW 2 Front View
VIEWPORTTYPE.TOPVIEW 3 Top Down View
VIEWPORTTYPE.CUSTOMVIEW 4 Custom View

# Template Library Type

Name Value Description
RESLIBTYPE.NONE 0 None
RESLIBTYPE.BLOCK 1 Blocks
RESLIBTYPE.ITEM 2 Items
RESLIBTYPE.MONSTER 3 Creatures
RESLIBTYPE.PARTICLE 4 Effects
RESLIBTYPE.SOUND 5 Sound Effects

# Obtain Trigger Variable

Name Value Description
VARTYPE.POSITION 1 Position
VARTYPE.AREAINS 2 Area
VARTYPE.NUMBER 3 Value
VARTYPE.STRING 4 String
VARTYPE.BOOLEAN 5 Boolean
VARTYPE.PLAYER 6 Player
VARTYPE.PLAYERGROUP 7 Player Set
VARTYPE.BLOCKTYPE 8 block type
VARTYPE.ITEMTYPE 9 Type
VARTYPE.CREATURE 10 Creature
VARTYPE.ACTORID 11 actor Types
VARTYPE.CREATUREGROUP 12 Creature Set
VARTYPE.TIMER 13 Timer
VARTYPE.EFFECTTYPE 14 effect type
Last Update: 6/11/2020, 9:30:46 PM