Minecraft (mc)
Actions
Rotation, velocity, attacking, clicking, keys and chat.
These functions change the game. They return the result from the native layer (usually true when the action was carried out).
Rotation
mc.setRotation(yaw, pitch)
Sets where you are looking, in degrees. Missing or invalid values count as 0.
mc.lookAt(x, y, z)
Turns to face a point. Also accepts one table. Returns false if there is no player.
mc.lookAt(Vector3.new(100, 64, 100))
Movement
mc.setVelocity(x, y, z)
Sets your velocity. Also accepts one table. Missing values count as 0.
Combat and clicking
mc.attack(target)
Attacks an entity. target is an entity table (its id is used) or an entity ID number.
mc.swing()
Plays the arm swing.
mc.click(button = "left")
Performs a click. button is "left", "right" or "middle".
mc.leftClick(), mc.rightClick(), mc.middleClick()
Shortcuts for mc.click with that button.
mc.isMouseDown(button = "left")
Returns whether that mouse button is held.
mc.useItem()
Uses the held item.
mc.selectSlot(i)
Selects hotbar slot i (0 to 8).
Keys
mc.setKey(name, down)
Presses or releases a key for the game. down is true or false.
mc.keyDown(name)
Returns whether a key is held. Same as UserInputService:IsKeyDown.
Chat
mc.chat(msg)
Sends a chat message (or a command if it starts with /) as the player.
mc.print(msg)
Shows a message in your own chat. Nothing is sent to the server.
mc.print("Script loaded")
mc.chat("/home")
For sending packets directly, see rnet.say and rnet.command.