from personal expirence the last time I tried to mod the game it was so spagettified (because of a horrible horrible mix of xml and js on top of the already messy java). It required atleast 1 beer to comprehend.
TLDR: the game isnt just a pure java game if it was that would be bad enough with how messy it is. Its also a javascript game because of the whole nashorn (js webkit) engine.
The way the game is kind of setup is a bit like gmod or the sims 4 or even skyrim. Where it has the "c++" (tho in this case its java which makes it a lot worse) backend and some kind of embeded scripting engine for the modding/small stuff scripts.
However unlike the professional engines seen in gmod/sims/skyrim which will clearly yell at you when your scripting is wrong either via a log file or an ingame popup. This game will just keep on trucking and have internal failures that can easily corrupt whole saves and not tell you anything until you compare your code to other mods/actual game code.
Also due to the fact that its running both a java and javascript interpreter at the same time and needs to keep both in sync on top of the whole keeping track of 1000s of npcs you just elbow on your way through the game it quickly falls apart.
if i remember from attempts at making I think some kind of pooltoy thing or some such at the time you needed code like
Code:
<action><![CDATA[#IF(some comparison here) {peform action here}]]></action>
Which looks simple and easy on the surface until you notice that none of your code is being checked for typos or completeness. And is also burried in a usually large xml document.
TLDR: the engine conceptually is a possibly a good idea (its concept is based off working examples seen in the wild) but the implmentation is a giant fractual mess.