Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Minescript Wiki › Guides › Run Your First Python Script in Chat

Run Your First Python Script in Chat

Basic Script Execution

Minescript lets you execute Python code directly from the Minecraft chat window. This is the foundation for all automation.

Steps

1. Open chat (default: T key)

2. Type /py followed by your Python command

3. Press Enter to execute

For example: /py player.print_chat("Hello World")

Simple Examples

Start with these basic commands:

  • player.print_chat("message") — Send text to your chat
  • player.get_pos() — Retrieve your current coordinates
  • player.get_rotation() — Check which direction you're facing

Multi-line Scripts

For longer scripts, you can paste multiple lines at once. The mod will execute them sequentially. Use proper Python indentation for loops and conditionals.

If your script has errors, the mod will display the error message in chat, helping you debug. Start simple, then build complexity as you become comfortable with the syntax.