CNPCs mod Scripting problem
sklll opened this issue ยท 6 comments
I have a problem: when I try to run scripts with CNPCs mod (Custom NPCs by Noppes)
It works ok most of the time, but when I try to do Forge event scripts like this:
var API = Java.type("noppes.npcs.api.NpcAPI").Instance()
function worldOut(message) {
API.getIWorld(0).broadcast(message)
}
It gives an error (See server-error.txt below)
Without FE everything works fine.
Checked on forgeessentials-1.12.2-12.3.30-server and on forgeessentials-1.12.2-12.3.41-server
forge-1.12.2-14.23.5.2796
To reproduce:
- Enable scripting with CNPCs (nashorn.jar should be in mods folder for JS)
- Run MC and right-click with a scripter tool in the air
- Pick "Forge"
- Make sure Enabled=YES https://www.dropbox.com/s/mbd5tf4igzzwqwh/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202019-02-01%2003.37.44.png?dl=0
- Add and navigate to tab 1
- Copy-paste the script to tab1
- Press Esc
Expected: no errors displayed
Actual: "ForgeScript script errored" message displayed
its saying Java.type does not exist for some reason (
feperm debug gives nothing: https://www.dropbox.com/s/mpzak2a7bc1b7kr/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202019-02-01%2002.49.43.png?dl=0
here are latest logs:
Server-CustomNPCs-latest.log
Server-debug.log
Server-latest.log
Server-error.txt
modlist.txt
Full version of the script - one part should be in Forge and other in Player scripts:
c_forge_mounts.txt
Is reproduced on different versions of CNPCs - on each I've checked including:
CustomNPCs_1.12.223Jan19snapshot2
CustomNPCs_1.12.2(30Jan19)
I believe these are relevant client logs:
2019-02-01-1.log.gz
debug-4.log.gz
Minimal version of the script is
log(Java);
produces this:
javaError.txt
@sklll This should be fixed in build 42. Please confirm.