Docs
- 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
v5.0b2
- Improve errors when Pyjinn can't find method/ctor (e88a241)
- Improve error message when Python can't be found (c1ef53d)
- Better message when Pyjinn script throws exception (a05ec73)
- Fix bug in method mappings for Fabric (4035ecc)
- Update Minescript version to 5.0b2, Pyjinn to 0.6 (6e76d2f)
Pyjinn 0.6
Docs
- 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
Minescript 5.0b1
- Pyjinn API change in method type checker (d583429)
- Support Outer.Nested class syntax with mappings (268f8b1)
- Fix mappings for nested classes and enums (0732f77)
- Unify use of mappings across Python and Pyjinn (c8e909d)
- Fix minescript.pyj to use valid Python syntax (782c5a2)
- Support passing non-JSON objects to Pyjinn events (8abfa8f)
- Make
__script__.vars["game"]threadsafe (394c25a) - Support "world" event for connect/disconnect (0c2d139)
- Refactor event handling into EventDispatcher class (6e63e6b)
- Normalize event listener registration logic (3325e66)
- Provide global game state shared by Pyjinn scripts (06dffbc)
Pyjinn 0.5
- Fix method resolution to check superclasses (81d840a)
- Remove java.vendor, build.timestamp from version (1f56d6f)
- Support Java array on rhs of
inoperator (3ec7633) - Support Outer.Nested class syntax (29f988c)
- Fix handling of int/long hex constants (94c28f3)
- Refactor TypeChecker methods for easier reuse (8f42a73)
- Promote functional params for calls of Java ctors (0383c7a)
- Support multi-threaded scripts, fix stack traces (08955c4)
- Update Pyjinn version to 0.5 (4198082)
- Simplify implementation of slice expression parser (456a4b1)
- Fix slice parser to respect blank slice values (817e8e2)
- Fix handling of int/long hex constants (94c28f3)
- Refactor TypeChecker methods for easier reuse (8f42a73)
- Promote functional params for calls of Java ctors (0383c7a)
- Support multi-threaded scripts, fix stack traces (08955c4)
- Update Pyjinn version to 0.5 (4198082)
- Simplify implementation of slice expression parser (456a4b1)
- Fix slice parser to respect blank slice values (817e8e2)
- Implement 'continue' statement inside loops (0a91f61)
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.



