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.0b3
- Fix Windows bug that can't find python from config (c22718d)
- Relax replacement of %userprofile% in Windows path (1500290)
- Use official class names of screens from mappings (bb90005)
- Define zombie callback handler for Pyjinn scripts (d088278)
- Fix bug in Pyjinn commands with quotes on Windows (7698fea)
- Support BlockPack, BlockPacker from Pyjinn scripts (e37cb05)
- Pass script filename for errors from parser (30f93c9)
- Fix bug in outgoing chat interceptor with no args (f10419b)
- Fix bug in eval.pyj for Windows that causes errors (241f0cc)
- Update Minescript to 5.0b3, Pyjinn to 0.7 (7f8cec5)
Pyjinn 0.7
- Fix type() for objects/classes defined in Pyjinn (de6ff69)
- Force class loading on eval of JavaClass() (7c52a81)
- Support zombie callback handler for exited scripts (b51d949)
- Make PyTuple and PyList streamable with stream() (5a5fa7a)
- Output filename, line num for Pyjinn syntax errors (7e4c292)
- Load class from JavaClass() at eval time (da1aff3)
- Update Pyjinn version to 0.7 (cf7f5ac)
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
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
in
operator (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
eval
script 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) -> int
set_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) -> int
remove_event_listener(listener_id: int) -> bool
- Basic support for
sys
module in Pyjinn scripts and stderr output:sys.argv, sys.exit(status=None), sys.version, sys.stdout, sys.stderr
print(..., 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
minescript
dir:import system.pyj.minescript
import system.pyj.minescript as m
from system.pyj.minescript import *
- for simpler imports and consistency with existing Python scripts you can use the short module name:
import minescript
import minescript as m
from minescript import *
- for simple IDE integration (e.g. VSCode) use the module name relative to the
- If there are no imports of
minescript
orsystem.pyj.minescript
in 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