thought Chest ID gave the ID of the chest? (Every one says ID 12)

  • @Captian_Cornball


    How do you retrieve the reference for chest?
    Every chest id is really unique!


    I give you a simple example how you can test it yourself.
    The following code gets activated when you open chests and prints out the chest id. (it throws an exception if not a chest, you have to implement the guarding yourself if used in production :) )

  • I've checked the Chest class, the chest.getID() function and also the PlayerObjectInteractionEvent, but they seem to be working as intended... ?(
    Maybe post the code here how you retrieve the chest objects (as mentioned by @Machete).

  • the above code gives these errors:


    java.lang.NullPointerException
    at e.a.a(SourceFile:339)
    at e.a.a(SourceFile:311)
    at pluginapi.objects.ChestAPI.insertNewItem(SourceFile:51)
    at BootyBay.onItemPickUpFromChest(BootyBay.java:29)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at pluginapi.PluginEventHandler.triggerEvent(SourceFile:201)
    at aU.f.a(SourceFile:942)
    at aU.f.messageReceived(SourceFile:119)
    at k.e.a(SourceFile:109)
    at k.c.run(SourceFile:65)


    please help me, i tied useing every type of syntax and get Nothing.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!