Tags
Creators
Details
All versions
5.0a4
Alpha
5.0a4 for NeoForge 1.21.716 months ago 35
Compatibility
Minecraft: Java Edition
1.21.7
Platform
NeoForge
Supported environments
Client-side
Changes
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
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:KcpXWngB:5Dv5iHFl"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:KcpXWngB:5Dv5iHFl"
}

