MineBot Plugin API
  • Introduction
  • Quick Start
  • Examples
    • Start Plugins
      • Events (basic)
      • Movement (basic)
      • Killaura (intermediate)
      • Wheat Farmer (intermediate)
    • Request Plugins
      • Chat (advanced)
    • Macro Component Additions
    • Botting Command Additions
    • BotViewer Additions
      • Base Extension
      • Chat Command Based Extension
  • API
    • ID System (Item & Block ids)
    • Events
    • Context
      • Player
      • Entities
        • IPlayerEntity
        • IMobEntity
        • IObjectEntity
      • World
        • IBlock
      • Containers
        • IWindow
        • ISlot
      • Functions
    • Utility
      • ChestMap
      • LocationBlacklistCollection
      • LocationWhitelistCollection
Powered by GitBook
On this page
  • Properties
  • Type
  • Object (legacy)
  • Methods
  • GetAge
  • HasLineOfSight
  • LookAt
  • LookAtSmooth
  • MoveTo
  • MoveToRange
  • Follow
  1. API
  2. Context
  3. Entities

IObjectEntity

Represents an instance of a world object. This includes entites such as dropped item stacks, falling sand, etc.

PreviousIMobEntityNextWorld

Last updated 5 years ago

Methods

Properties

GetAge

Type

HasLineOfSight

Object

LookAt

EntityId

LookAtSmooth

Position

MoveTo

HasDespawned

MoveToRange

Follow

Properties

Type

Denotes the type of this object, e.g.: ItemStack, Boat, Minecart. The full list of types can be found in .

Object (legacy)

This variable should be casted to a more specific type by checking the Type variable and casting based on that. A full list of types that this can be casted to can be found . This will expose more relevant variables to the object, such as ProjectileObject has the entityId of the entity that shot it.

// Example: casting based on Type
if(theObject.Type == ObjectTypes.Snowball)
    Console.WriteLine($"Entity with id {((ProjectileObject)theObject).shooterId} threw a snowball.");

Methods

GetAge

Returns the number of ticks that this object has existed for. This starts counting up as soon as this object is sent to the bot by the server (time since render). Each tick in this case refers to a Minecraft tick, which is 50ms per tick.

int GetAge();

HasLineOfSight

Returns whether the bot has direct line of sight to this object. This only works if the object is within 64 blocks of the bot. You can optionally specify a specific body part to test against (default is BodyParts.Body).

bool HasLineOfSight(BodyParts bodyPart = BodyParts.Body);

LookAt

Rotates the bots head to look at the object. This can be used to look at a specific part of the object, such as the head, feet, or the body (default is BodyParts.Body). Returns a Task that lasts around 1 tick, which is how long it takes the server to update the players rotation.

Task LookAt(BodyParts bodyPart = BodyParts.Body);

LookAtSmooth

Smoothly (slowly, per multiple ticks) rotates the bots head to look at the object. This can be used to look at a specific part of the object, such as the head, feet, or the body (default is BodyParts.Body). You should await for this function to complete, as the rotation time is dynamic. You can optionally specify the look speed, however it is recommended to leave it as 'auto'.

Task LookAtSmooth(BodyParts bodyPart = BodyParts.Body, LookSpeed speed = LookSpeed.auto

MoveTo

IMoveTask MoveTo();

MoveToRange

IMoveTask MoveToRange(int maxRange, MapOptions options = null);

Follow

IMoveTask Follow(MapOptions options = null)
IMoveTask Follow(int maxRange, MapOptions options = null)
IMoveTask Follow(int maxRange, int minRange, MapOptions options = null)

Attempts to move the location of this player. This is a wrapper function for , for more information check that.

Attempts to move the bot into the specified range of this player. You must specify the max distance that we can be from this player to still be considered in range. This is a wrapper function for , for more information check that.

Attempts to move the location of this object, if the object is moved then the path is recalculated and updated. This is a wrapper function for , for more information check that.

OQ.MineBot.PluginBase.Classes.Entity.Objects.ObjectTypes
here
Player.MoveTo
Player.MoveToRange
Player.FollowEntity