DISCLAIMER! THIS LIBRARY DOES NOT LET YOU CREATE MODS IN PYTHON!
A library providing Jython for use within minecraft mods.
There's two methods to initialize the python system:
- Add
"jythonmc:use" : true
tocustom
in yourfabric.mod.json
this will automatically start the python system when JythonMC is loaded - Call
com.enderzombi102.jythonmc.Jython.initSystem()
this will initialize the python system, but if its already initialized it'll do nothing
After the system is initialized, you can use the python interpreter liek this:
try ( PythonInterpreter python = new PythonInterpreter() ) {
python.setErr(System.err); // to set python's stderr
python.setOut(System.out); // to set python's stdout
python.exec(CODE); // executes the code in the string CODE
} catch (Exception e) {
e.printStackTrace(); // python exceptions are translated to java ones if nothing catch them
}
build.gradle
repositories {
mavenCentral()
maven {
url 'https://repo.repsy.io/mvn/enderzombi102/mc/'
}
}
dependencies {
modImplementation "com.enderzombi102:JythonMC:$jythonmc_version"
}
gradle.properties
jythonmc_version=1.0.2
jythonmc's People
jythonmc's Issues
what is this?
hello, sorry for the disturbance but i have some questions in my mind and didn't know where else to ask these questions.
i was just about to start learning java (as my first programming language) to develop minecraft mods but i also want to learn python, then when i opened modrinth, i saw this mod.
what is jythonmc? does it allow you to write code in python and convert it to java code that minecraft understands?
how good is it's performance?
is it complete?
can i do anything with it?
again, sorry for taking your time.
Many issues
There are a lot of inconsistencies in naming (jython
or jythonmc
)
- this line should say
jythonmc
, because is crashes otherwise
Following the guide in README also causes crashes
NoClassDefFoundError
is thrown because the package's name iscom.enderzombi102.jython
notcom.enderzombi102.jythonmc
- the guide should contain mention about adding
include implementation("org.python:jython:$jython_version")
to dependencies, as without that aNoClassDefFoundError
will be thrown
Even after jumping through those hoops, I wasn't able to run jython interperter, as another error occured while trying to run exec
from PythonInterpreter
:
Cannot read field "modules" because the return value of "org.python.core.Py.getSystemState()" is null
If you want to see the code I tried, its here
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.