game
These function(s) are used for gathering or setting informaton from Minecraft. Most of these functions will NOT have a description because they are self-explanatory.
is_in_fov
Description
This will check if an entity is within an FOV range. This will also return any calculated angles and the result of the FOV check in the case it fails. The Reach script shows an example of how the x and z returned values are used.
Parameters
number
number
number
Returns
boolean
number
x_anglenumber
z_anglenumber
actual_fov_yaw_differencenumber
actual_fov_pitch_difference
Example
get_player
Description
This will get the player/entity and some vital data.
Parameters
number
Returns
-
get_xp
- This gets the experience amount. Not the level.
-
get_name
-
get_index
- You can either use this function or simply access the
index
member.
- You can either use this function or simply access the
-
get_hurt_time
- The duration the entity is being hurt for.
-
get_recently_hit
- Get time entity was recently hurt.
-
get_last_attacker
- This will get the index of the entity that last attacked this entity.
-
get_last_attacker_time
- Get time entity was recently attacked by another entity.
-
get_last_damage
- The last amount of damage that was taken.
-
get_eye_height
-
get_position
table
->number
xnumber
ynumber
z
-
get_motion
table
->number
xnumber
ynumber
z
-
get_air_speed
- This tends to be a static value.
-
get_ground_speed
- This tends to be a static value.
-
get_armor_value
-
get_swing_progress
-
get_forward
-
get_strafing
-
get_ping
- Sometimes inaccurate or dysfunctional.
-
is_user
-
is_alive
-
get_closest_entities( number )
table
entities
Example
Lua | |
---|---|
trace_ray_blocks
Description
This function will perform a TraceRay of an entity to depending on the distance. If the trace is successful, this function returns the x, y, z position of the block.
Parameters
number
entitynumber
reach_distancenumber
ticks
Returns
boolean
number
xnumber
ynumber
z
Example
Lua | |
---|---|
trace_ray_mouse
Description
This function will perform a TraceRay based on your mouse position. This is determined by Minecraft returning whether your mouse is over an object or not. This only works with the local player. The type_hit
represents the enumeration MovingObjectPosition.MovingObjectType.
This function seemingly does not return an entity. This has been reported multiple times with older Minecraft versions. However, you can use this function with parallatic.game.is_in_fov
and the distance function instead of this. I would not personally consider this function reliable.
Returns
number
entitynumber
type_hitnumber
xnumber
ynumber
z
Example
Lua | |
---|---|
get_players
Description
This creates a nested table of parallatic.game.get_player
of players on the server. (not entities)
Returns
table
Example
Lua | |
---|---|
get_entities
Description
This creates a nested table of parallatic.game.get_player
of entities on the server. Players ARE included. This will get all entities. This includes dropped items, mobs, experience orbs, etc.
Returns
table
Example
Lua | |
---|---|
is_using_item
Description
If the item can be right used, this will return true. This will always return true regardless of the transaction and item that is being used.
Parameters
number
Returns
boolean
Example
Lua | |
---|---|
is_blocking
Description
This will check if an entity is blocking.
Parameters
number
Returns
boolean
Example
Lua | |
---|---|
is_spectator
Description
This will check if an entity is spectating.
Parameters
number
Returns
boolean
is_invisible_to_player
Description
This will check if an entity is invisible to another player.
Parameters
number
number
Returns
boolean
Example
Lua | |
---|---|
is_spectating_player
Description
This will check if an entity is spectating another entity.
Parameters
number
number
Returns
boolean
Example
Lua | |
---|---|
is_in_bed
Description
This will check if an entity is in bed.
Parameters
number
Returns
boolean
is_wet
Parameters
number
Returns
boolean
is_sneaking
Parameters
number
Returns
boolean
is_riding
Description
This will check if an entity is riding anything.
Parameters
number
Returns
boolean
is_in_water
Parameters
number
Returns
boolean
is_jumping
Parameters
number
Returns
boolean
is_airborne
Parameters
number
Returns
boolean
is_on_ground
Parameters
number
Returns
boolean
is_sprinting
Parameters
number
Returns
boolean
is_eating
Parameters
number
Returns
boolean
is_burning
Parameters
number
Returns
boolean
is_in_lava
Parameters
number
Returns
boolean
is_invisible
Parameters
number
Returns
boolean
get_bounding_box
Description
Gets the bounding box of an entity. The Reach script shows an example of how this is used.
Parameters
number
Returns
number
number
number
number
number
number
number
set_bounding_box
Description
Sets the bounding box of an entity. The Reach script shows an example of how this is used.
Parameters
number
number
number
number
number
number
number
set_angles
Description
This sets the pitch and yaw of the localplayer.
Parameters
number
number
set_rotation
Description
This sets the rotation of the localplayer.
Parameters
number
number
set_velocity
Description
This sets the velocity of the localplayer.
Parameters
number
number
number
get_health
Description
It's better to use parallatic.game.get_player
to get this instead. It's already included in the return table.
Parameters
number
Returns
number
get_entity_name
Description
It's better to use parallatic.game.get_player
to get this instead. It's already included in the return table.
Parameters
number
Returns
string
get_horse_jump_power
Description
This will get the horse the entity is riding's jumping power.
Parameters
number
Returns
number
get_inventory
Description
This function will get all items in your inventory and its qualities as a nested table. This function is not completed and as a result will be missing documentation.
Parameters
number
get_item_in_slot
Description
This will get an item in a specific slot in your inventory. The first parameter is seeking the slot number. See this for the slot numbers.
Parameters
number
Returns
table -->
string
namestring
raw_name
set_item_in_slot
Description
This will move an item from 1 slot in your inventory to another slot. See this for the slot numbers.
Parameters
number
number
get_yaw
Description
Gets the yaw of an entity.
Parameters
number
Returns
number
get_pitch
Description
Gets the pitch of an entity.
Parameters
number
Returns
number
get_hotbar_slot
Description
This will return what hotbar slot is currently active.
Returns
number
jump
Description
Jumps your localplayer.
set_pitch
Description
This sets the pitch of the localplayer.
Parameters
number
set_yaw
Description
This sets the yaw of the localplayer.
Parameters
number
get_motion
Description
Gets the motion of an entity.
Parameters
number
Returns
number
number
number
is_focused
Description
This function checks whether any GUI or menu is open. This function will return true
if your player is able to move, look, interact with the world, etc. Otherwise or if any GUI or menu is open, this will return false
.
Returns
boolean
is_paused
Description
Checks whether the game is paused or not.
Returns
boolean
is_gui_enabled
Description
Checks whether a gui is enabled or not.
Returns
boolean
is_fullscreen
Description
Checks whether the game is in fullscreen or not.
Returns
boolean
is_singleplayer
Description
Checks whether you are in singleplayer or not.
Returns
boolean
can_attack_player
Description
Checks whether you can attack a player or not.
Parameters
number
Returns
boolean
attack_entity
Description
Automatically attacks an entity for you. This will not trigger the attacking animation and will only work if you are within reach distance.
Parameters
number
is_survival_or_adventure
Description
Checks whether you are in survival or adventure mode.
Returns
boolean
is_reach_extended
Description
Checks whether the server extended the reach of your player.
Returns
boolean
is_spectator_mode
Description
Checks whether you are in spectator mode.
Returns
boolean
is_hitting_block
Description
Checks whether you are hitting a block. This only works with blocks that don't automatically break in one hit. Creative mode does this automatically.
Returns
boolean
get_reach_distance
Description
Gets the reach distance of your player.
Returns
number