Updates in Minescript 5.0 alpha 4
- For Pyjinn integration with Java and language compatibility with Python see minescript.net/pyjinn
- To set up Fabric mappings for Pyjinn scripts see minescript.net/mappings
- Built-in
evalscript is now implemented using Pyjinn (eval.pyj); Python eval command is now available aspyeval - Introduce
set_interval()andset_timeout()which behave similiarly tosetInterval()andsetTimeout()in JavaScript:set_interval(callback: Callable[..., None], timer_millis: int, *args) -> intset_timeout(callback: Callable[..., None], timer_millis: int, *args) -> int
- Introduce
remove_event_listener()which cancels listeners using the int ID returned fromadd_event_listener(),setInterval(), andsetTimeout():add_event_listener(event_type: str, callback: Callable[..., None], **args) -> intremove_event_listener(listener_id: int) -> bool
- Basic support for
sysmodule in Pyjinn scripts and stderr output:sys.argv, sys.exit(status=None), sys.version, sys.stdout, sys.stderrprint(..., file=sys.stderr)
- Support for output redirection of Pyjinn scripts:
\eval 'print("Send this message to other players via chat.")' > chat
- Scripts can explicitly import the Pyjinn version of the Minescript standard library
- for simple IDE integration (e.g. VSCode) use the module name relative to the
minescriptdir:import system.pyj.minescriptimport system.pyj.minescript as mfrom system.pyj.minescript import *
- for simpler imports and consistency with existing Python scripts you can use the short module name:
import minescriptimport minescript as mfrom minescript import *
- for simple IDE integration (e.g. VSCode) use the module name relative to the
- If there are no imports of
minescriptorsystem.pyj.minescriptin the main script, it is imported implicitly as:from system.pyj.minescript import *
Updates in Minescript 5.0 alpha 3
Support for event listeners in Pyjinn scripts for these events:
- tick, render, key, mouse, chat, outgoing_chat_intercept, add_entity, block_update, explosion, take_item, damage, chunk
e.g.
frames = 0
def on_render(event):
global frames
frames += 1
if frames % 1000 == 0:
print(f"Rendered {frames} frames.")
add_event_listener("render", on_render)
Support for Minescript functions in Pyjinn scripts using the same API and syntax as Python scripts:
- execute, echo, echo_json, chat, log, screenshot, job_info, player_name, player_position, player_hand_items, player_inventory, player_inventory_select_slot, press_key_bind, player_press_forward, player_press_backward, player_press_left, player_press_right, player_press_jump, player_press_sprint, player_press_sneak, player_press_pick_item, player_press_use, player_press_attack, player_press_swap_hands, player_press_drop, player_orientation, player_set_orientation, player_get_targeted_block, player_get_targeted_entity, player_health, player, players, entities, version_info, world_info, getblock, getblocklist, screen_name, show_chat_screen, append_chat_history, chat_input, set_chat_input, container_get_items, player_look_at
Updates in Minescript 5.0 alpha 3
Support for event listeners in Pyjinn scripts for these events:
- tick
- render
- key
- mouse
- chat
- outgoing_chat_intercept
- add_entity
- block_update
- explosion
- take_item
- damage
- chunk
e.g.
frames = 0
def on_render(event):
global frames
frames += 1
if frames % 1000 == 0:
print(f"Rendered {frames} frames.")
add_event_listener("render", on_render)
Support for Minescript functions in Pyjinn scripts using the same API and syntax as Python scripts:
- execute
- echo
- echo_json
- chat
- log
- screenshot
- job_info
- player_name
- player_position
- player_hand_items
- player_inventory
- player_inventory_select_slot
- press_key_bind
- player_press_forward
- player_press_backward
- player_press_left
- player_press_right
- player_press_jump
- player_press_sprint
- player_press_sneak
- player_press_pick_item
- player_press_use
- player_press_attack
- player_press_swap_hands
- player_press_drop
- player_orientation
- player_set_orientation
- player_get_targeted_block
- player_get_targeted_entity
- player_health
- player
- players
- entities
- version_info
- world_info
- getblock
- getblocklist
- screen_name
- show_chat_screen
- append_chat_history
- chat_input
- set_chat_input
- container_get_items
- player_look_at
Updates in Minescript 5.0 alpha 2
This is the first step in calling Minescript script functions from Pyjinn scripts, for example:
# pyjinn_test.pyj
Minescript = JavaClass("net.minescript.common.Minescript")
def call(func_name, args):
return Minescript.call(func_name, args.getJavaList())
print(call("player_get_targeted_block", [20]))
print(call("world_info", []))
print("minescript version:", call("version_info", []).get("minescript"))
call("echo", ["hello?"])
call("echo_json", ['{"text": "hello", "color": "green"}'])
call("execute", ["time set day"])
Follow-up changes will make the syntax more natural, allowing scripts
to call functions like player_get_targeted_block(20) directly.
Update version to 5.0a2.
Updates in Minescript 5.0 alpha 1
WARNING: This is a pre-release version with features that are incomplete and APIs are subject to change and compatibility with the final release is not guaranteed.
Support for integrated Pyjinn interpreter. Files placed in the minescript directory ending in .pyj and written with Python syntax are interpreted without the need for an external Python installation. Minescript API functions are not yet supported from Pyjinn scripts. Java code can be run from scripts similar to Python scripts with Minescript 4.0 using lib_java.py.
Updates in Minescript 4.0.1
Fixes for breaking changes in NeoForge's event-registration APIs in 21.6.x beta. Users of 4.0 for NeoForge 1.21.6 should upgrade to this version.
Updates in Minescript 4.0
player_inventory_slot_to_hotbar()no longer supported becauseServerboundPickItemPacketwas removed in Minecraft 1.21.4 (e159e5b)- Support running script functions during tick loop (20x per second), render loop (30-100+ fps), or script loop (~5000 times per second) (923f9bb, bfbd192, fb936b8)
- Java reflection via Python script functions, including ability to call script functions from Java (ebdba54, 8008110, 39160c3, 8d97911)
- Introduce Tasks for efficient, synchronous batching of script function calls, including Java reflection (d2bd144, 1377acb, 19eb79c, 0762eaa, 12e7306, f8ed176, 023fd05, 1efbd90, 07388d9)
- Support Python scripts in arbitrary folders using
command_pathinconfig.txt(791c295, 99c8619, 23ee273) - Support alternative script languages for commands (890d2a9)
- Support for NeoForge, starting with Minecraft 1.20.2 (7dd592f)
- Schedule groups of script functions to run every render or tick cycle with dynamically updated values (19eb79c, 1377acb, d2bd144, 0762eaa)
- Support for scripting several game and input events with a unified
EventQueueAPI (d1cb4c9, 6628525, 993c9b6, b96159e, 4af1a32) - Async script functions that are more powerful, easier to use, and cancellable (882bc7e)
- Unified Minescript and Minecraft chat histories when using up/down arrows (46a0cde)
- New and updated script functions, including:
press_key_bind()(174dac8)show_chat_screen()(adf8dac)- entity selectors for
entities()andplayers()(6d6d627) job_info()for detecting other running scripts (156dc33)version_info()for detecting versions of Minecraft, Minescript, and OS (d448c4b)- multiple args to
echo(),chat(), andlog(), like builtinprint()function (114c559) append_chat_history(),chat_input(), andset_chat_input()for managing chat input and history (46a0cde)player_get_targeted_entity()(93dd5e8)
- Return complex data types from script functions as dataclasses (e.g.
EntityData) rather than dicts, for easier and safer scripting (7caaf3b) - Support tab completion of
configandhelpparams (b4bfa0e, f485973) - Safer script output:
print()no longer executes commands or sends public messages to chat by default (6101484)
See detailed changelog.
Beta release
This beta version of Minescript for 1.21.6 on Forge lacks support for tab completion of Minescript commands due to changes in Forge's event-handling APIs.
Updates in Minescript 4.0
player_inventory_slot_to_hotbar()no longer supported becauseServerboundPickItemPacketwas removed in Minecraft 1.21.4 (e159e5b)- Support running script functions during tick loop (20x per second), render loop (30-100+ fps), or script loop (~5000 times per second) (923f9bb, bfbd192, fb936b8)
- Java reflection via Python script functions, including ability to call script functions from Java (ebdba54, 8008110, 39160c3, 8d97911)
- Introduce Tasks for efficient, synchronous batching of script function calls, including Java reflection (d2bd144, 1377acb, 19eb79c, 0762eaa, 12e7306, f8ed176, 023fd05, 1efbd90, 07388d9)
- Support Python scripts in arbitrary folders using
command_pathinconfig.txt(791c295, 99c8619, 23ee273) - Support alternative script languages for commands (890d2a9)
- Support for NeoForge, starting with Minecraft 1.20.2 (7dd592f)
- Schedule groups of script functions to run every render or tick cycle with dynamically updated values (19eb79c, 1377acb, d2bd144, 0762eaa)
- Support for scripting several game and input events with a unified
EventQueueAPI (d1cb4c9, 6628525, 993c9b6, b96159e, 4af1a32) - Async script functions that are more powerful, easier to use, and cancellable (882bc7e)
- Unified Minescript and Minecraft chat histories when using up/down arrows (46a0cde)
- New and updated script functions, including:
press_key_bind()(174dac8)show_chat_screen()(adf8dac)- entity selectors for
entities()andplayers()(6d6d627) job_info()for detecting other running scripts (156dc33)version_info()for detecting versions of Minecraft, Minescript, and OS (d448c4b)- multiple args to
echo(),chat(), andlog(), like builtinprint()function (114c559) append_chat_history(),chat_input(), andset_chat_input()for managing chat input and history (46a0cde)player_get_targeted_entity()(93dd5e8)
- Return complex data types from script functions as dataclasses (e.g.
EntityData) rather than dicts, for easier and safer scripting (7caaf3b) - Support tab completion of
configandhelpparams (b4bfa0e, f485973) - Safer script output:
print()no longer executes commands or sends public messages to chat by default (6101484)
See detailed changelog.
THIS VERSION IS BROKEN!
The NeoForge beta for 1.21.6 introduced a breaking change to the some of the event-registration APIs. Please install 4.0.1 for NeoForge 1.21.6 instead.
Updates in Minescript 4.0
player_inventory_slot_to_hotbar()no longer supported becauseServerboundPickItemPacketwas removed in Minecraft 1.21.4 (e159e5b)- Support running script functions during tick loop (20x per second), render loop (30-100+ fps), or script loop (~5000 times per second) (923f9bb, bfbd192, fb936b8)
- Java reflection via Python script functions, including ability to call script functions from Java (ebdba54, 8008110, 39160c3, 8d97911)
- Introduce Tasks for efficient, synchronous batching of script function calls, including Java reflection (d2bd144, 1377acb, 19eb79c, 0762eaa, 12e7306, f8ed176, 023fd05, 1efbd90, 07388d9)
- Support Python scripts in arbitrary folders using
command_pathinconfig.txt(791c295, 99c8619, 23ee273) - Support alternative script languages for commands (890d2a9)
- Support for NeoForge, starting with Minecraft 1.20.2 (7dd592f)
- Schedule groups of script functions to run every render or tick cycle with dynamically updated values (19eb79c, 1377acb, d2bd144, 0762eaa)
- Support for scripting several game and input events with a unified
EventQueueAPI (d1cb4c9, 6628525, 993c9b6, b96159e, 4af1a32) - Async script functions that are more powerful, easier to use, and cancellable (882bc7e)
- Unified Minescript and Minecraft chat histories when using up/down arrows (46a0cde)
- New and updated script functions, including:
press_key_bind()(174dac8)show_chat_screen()(adf8dac)- entity selectors for
entities()andplayers()(6d6d627) job_info()for detecting other running scripts (156dc33)version_info()for detecting versions of Minecraft, Minescript, and OS (d448c4b)- multiple args to
echo(),chat(), andlog(), like builtinprint()function (114c559) append_chat_history(),chat_input(), andset_chat_input()for managing chat input and history (46a0cde)player_get_targeted_entity()(93dd5e8)
- Return complex data types from script functions as dataclasses (e.g.
EntityData) rather than dicts, for easier and safer scripting (7caaf3b) - Support tab completion of
configandhelpparams (b4bfa0e, f485973) - Safer script output:
print()no longer executes commands or sends public messages to chat by default (6101484)
See detailed changelog.
Updates in Minescript 4.0
player_inventory_slot_to_hotbar()no longer supported becauseServerboundPickItemPacketwas removed in Minecraft 1.21.4 (e159e5b)- Support running script functions during tick loop (20x per second), render loop (30-100+ fps), or script loop (~5000 times per second) (923f9bb, bfbd192, fb936b8)
- Java reflection via Python script functions, including ability to call script functions from Java (ebdba54, 8008110, 39160c3, 8d97911)
- Introduce Tasks for efficient, synchronous batching of script function calls, including Java reflection (d2bd144, 1377acb, 19eb79c, 0762eaa, 12e7306, f8ed176, 023fd05, 1efbd90, 07388d9)
- Support Python scripts in arbitrary folders using
command_pathinconfig.txt(791c295, 99c8619, 23ee273) - Support alternative script languages for commands (890d2a9)
- Support for NeoForge, starting with Minecraft 1.20.2 (7dd592f)
- Schedule groups of script functions to run every render or tick cycle with dynamically updated values (19eb79c, 1377acb, d2bd144, 0762eaa)
- Support for scripting several game and input events with a unified
EventQueueAPI (d1cb4c9, 6628525, 993c9b6, b96159e, 4af1a32) - Async script functions that are more powerful, easier to use, and cancellable (882bc7e)
- Unified Minescript and Minecraft chat histories when using up/down arrows (46a0cde)
- New and updated script functions, including:
press_key_bind()(174dac8)show_chat_screen()(adf8dac)- entity selectors for
entities()andplayers()(6d6d627) job_info()for detecting other running scripts (156dc33)version_info()for detecting versions of Minecraft, Minescript, and OS (d448c4b)- multiple args to
echo(),chat(), andlog(), like builtinprint()function (114c559) append_chat_history(),chat_input(), andset_chat_input()for managing chat input and history (46a0cde)player_get_targeted_entity()(93dd5e8)
- Return complex data types from script functions as dataclasses (e.g.
EntityData) rather than dicts, for easier and safer scripting (7caaf3b) - Support tab completion of
configandhelpparams (b4bfa0e, f485973) - Safer script output:
print()no longer executes commands or sends public messages to chat by default (6101484)
See detailed changelog.



