Every chest in the world has the same exact iD?
any way, How do I differntiate between the chests??
evey chest says ID 12.
Every chest in the world has the same exact iD?
any way, How do I differntiate between the chests??
evey chest says ID 12.
How do you retrieve the chest id? The getID() method in the chest class is supposed to return the global chest ID (which is usually unique).
int c=chest.getID();
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 wes using that evenmt and it sad chest ID 12
You made a typo in your code final int infoId = event.getChestID();
but thank you for helping no more chest ID 12... i just thougt assiguing an integer to a chest ID would show it
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.
Don’t have an account yet? Create a new account now and be part of our community!