spockbot.plugins.helpers.interact module¶
Interact with the world: - swing the arm, sneak, sprint, jump with a horse, leave the bed - look around - dig/place/use blocks - use the held (active) item - use/attack entities - steer vehicles - place and write signs - edit and sign books
By default, the client sends swing and look packets like the vanilla client.
This can be disabled by setting the auto_swing and auto_look flags.
-
class
spockbot.plugins.helpers.interact.InteractPlugin(ploader, settings)¶ Bases:
spockbot.plugins.base.PluginBase-
activate_item()¶ Use (hold right-click) the item in the active slot. Examples: pull the bow, start eating once, throw an egg.
-
attack_entity(entity)¶
-
cancel_digging()¶
-
click_block(pos, look_at_block=True, swing=True, **kwargs)¶ Click on a block. Examples: push button, open window, make redstone ore glow
Parameters: - face (int) – side of the block on which the block is placed on
- cursor_pos (Vector3) – where to click inside the block, each dimension 0-15
-
deactivate_item()¶ Stop using (release right-click) the item in the active slot. Examples: shoot the bow, stop eating.
-
dig_block(pos)¶ Not cancelable.
-
edit_book(pages)¶ Set the pages of current book in hand
-
finish_digging()¶
-
jump_horse(jump_boost=100)¶
-
jump_vehicle()¶
-
leave_bed()¶
-
look(yaw=0.0, pitch=0.0, radians=False)¶
-
look_at(pos)¶
-
look_at_rel(delta)¶
-
look_rel(d_yaw=0.0, d_pitch=0.0, radians=False)¶
-
mount_vehicle(entity)¶
-
open_inventory()¶
-
pl_announce= ('Interact',)¶
-
place_block(pos, sneak=True, **kwargs)¶ Place a block next to
pos. If the block atposis air, place atpos.
-
place_sign(pos, lines=[], **place_block_kwargs)¶ Place a sign block and write on it.
-
requires= ('ClientInfo', 'Event', 'Inventory', 'Net', 'Channels')¶
-
sign_book(author, title)¶ Sign current book in hand
-
sneak(sneak=True)¶
-
sprint(sprint=True)¶
-
start_digging(pos, face=1)¶
-
steer_vehicle(left=0.0, forward=0.0, jump=False, unmount=False)¶
-
swing_arm()¶
-
unmount_vehicle()¶
-
unsneak()¶
-
unsprint()¶
-
use_bucket(pos)¶ Using buckets is different from placing blocks. See “Special note on using buckets” in http://wiki.vg/Protocol#Player_Block_Placement
-
use_entity(entity, cursor_pos=None, action=0)¶ Uses (right-click) an entity to open its window. Setting
cursor_possetsactionto “interact at”.
-
write_book(text, author='', title='', sign=False)¶ Write text to the current book in hand, optionally sign the book
-