CraftTweaker

CraftTweaker

151M Downloads

Unhelpful error message when an invalid entity name is given

josephcsible opened this issue ยท 3 comments

commented

Issue Description:

When an invalid entity name is given to game.getEntity, the error message is very unhelpful in figuring out what the problem is.

What happens:

The message ERROR: Error executing test.zs: null is printed, and a NullPointerException stack trace is written to the log.

What you expected to happen:

I expected to get a message like this: ERROR: test.zs:1: Could not resolve "EnderDrgaon", like you do now if you give an invalid item name.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

test.zs

Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

minetweaker.log


Affected Versions (Do not use "latest"):

  • Minecraft: 1.11.2
  • Forge: 13.20.1.2414
  • Crafttweaker: 1.11.2-3.0.26

Your most recent log file where the issue was present:

Minecraft log

commented

Use <entity:ebderdragon> does the same thing, but has better output

commented

Ah, forgot to add the bracket handler way...

<entity:sheep>.addDrop(<minecraft:dirt>, 1, 5);
<entity:sheep>.addPlayerOnlyDrop(<minecraft:stick>, 1, 5);
<entity:sheep>.addDrop(<minecraft:diamond>);
<entity:sheep>.removeDrop(<minecraft:wool:*>);

is what I have in my test script

commented

Thanks, I didn't know about that syntax. There doesn't seem to be documentation for mob drops anywhere, so I just took what I was using from your last comment in #37.