BananaPuncher714 / NBTEditor

A single class NBT editor for items, skulls, mobs, and tile entities
MIT License
138 stars 29 forks source link

java.lang.reflect.InvocationTargetException #31

Closed DexterSK closed 1 year ago

DexterSK commented 1 year ago
[12:47:49 WARN]: java.lang.reflect.InvocationTargetException
[12:47:49 WARN]:        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[12:47:49 WARN]:        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
[12:47:49 WARN]:        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[12:47:49 WARN]:        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[12:47:49 WARN]:        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
[12:47:49 WARN]:        at utils.NBTEditor.getHead(NBTEditor.java:461)
BananaPuncher714 commented 1 year ago

Thanks, I'll try to update NBTEditor this weekend.

DexterSK commented 1 year ago

Thanks you too! :)

EDIT: i fixed it by changing getConstructor( getNMSClass( "GameProfile" ) ).newInstance( UUID.randomUUID(), null ); to getConstructor( getNMSClass( "GameProfile" ) ).newInstance( UUID.randomUUID(), "" );

BananaPuncher714 commented 1 year ago

Thanks, it seems that the 1.20.2 constructor for a GameProfile has a null check for the name, which wasn't there previously.