CraftTweaker

CraftTweaker

151M Downloads

Crash when wolves kill sheep with custom drops sometimes(Item stacks returning null)

3nd0fw0r1d opened this issue ยท 1 comments

commented

Issue Description:

The crash is specifically caused so far by wolves killing sheep, because I have them custom drop bones.
Does not happen when I kill them by hand.

Further testing:
changing entitys.addDrop(bone % 70,0,2);
to entitys.addDrop(bone % 70,1,2);
Fixes my crashing

What happens:

Forge no likey, exits game.

What you expected to happen:

No crash.

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

https://pastebin.com/GusVhjFg

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

https://pastebin.com/3BaSJDdG


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 1.12.2-14.23.0.2549
  • Crafttweaker: 4.0.10

Your most recent log file where the issue was present:

https://pastebin.com/Lg43PWEY

commented

Your problem is that you are allowing itemStacks with a size of 0.
An itemStack with size 0 is an empty stack and these aren't supported in the event handler.
You need to use at least 1 as lower boundary.

The 0 case is already covered by the chance you give the item to drop.