Unfortunately the forums, server list and report tool were offline last night due to technical issues. Sorry for the inconvenience! It should be working again.
However, unfortunately the Standalone update is temporarily not available. We expect it to be fixed in a couple of hours. Please let me know if you want to get a Steam key instead!
-
Its STILL giving Null exemtiona
-
public void PlayerInventoryToChestEvent(PlayerInventoryToChestEvent event){
Player player = event.getPlayer();
final int infoId = event.getChestID();
String Pname = player.getName();
Chest chest = getWorld().getChest(infoId);
Item[] Items = chest.getItems();
//Item item = event.getItem();
// player.sendTextMessage("yes"+NameofItem);
if (Items.getName() != null && Items.getName().equals("bandage")){
player.sendTextMessage("[#FF0000]BootyBux: ");
Display More
What i Evetually want this to do is check Weather an item is "Sellable" and the Sell Price (the Prices will change and be Written to a databse )
right now this is just to get the man code working,
Im using a chest to "eat"the item and give the correct amout of money for it.
-
It Has to be the limitatons of the API, I know what you are getting at at and
Item item = chest.getItem(); cannot be done.
Item item = chest.getItem(1); this is the Correct Syntax.
-
public void PlayerInventoryToChestEvent(PlayerInventoryToChestEvent event){
Player player = event.getPlayer();
final int infoId = event.getChestID();
String Pname = player.getName();
Chest chest = getWorld().getChest(infoId);
Item[] Items = chest.getItems();
// player.sendTextMessage("yes"+NameofItem);
if (items.getName() != null && item.getName().equals("bandage")){
ive Tried all Three Methods and get "Cannot Find Symbol"
if i use getitem without (1) i get "Found no Arguments"
this CANNOT be done
Maybe Red can explain why we need an argument for getItem();
-
ive Tried everythng, Either the API is severly bugged or I''m a horrble coder..
if you want to help, Join my discord channel
-
public void PlayerInventoryToChestEvent(PlayerInventoryToChestEvent event){
Player player = event.getPlayer();
final int infoId = event.getChestID();
String Pname = player.getName();
Chest chest = getWorld().getChest(infoId);
Item item = chest.getItem(1);
//Item item = event.getItem();
if (item.getName().equals("bandage")){
player.sendTextMessage("yes");
// player.sendTextMessage(""+Invent[i]);
player.sendTextMessage("no");
player.sendTextMessage("[#ffff00] chest id: " + chest.getID());
String query = "SELECT * FROM Money WHERE `User` = '" + Pname + "'";
try (ResultSet result = db.executeQuery(query)){
String User= result.getString("User");
int Amount = result.getInt("Amount");
int total = Amount+addto;
db.executeUpdate("UPDATE `Money` SET `Amount` = '" + total + "' WHERE `User` = '" + Pname + "' ");
player.sendTextMessage("[#ffff00] chest id: " + chest.getID());
Display More
the problem is with
line 8 on
this is the Whole Block, the cose itself is 300 lines long.
-
whoops thought i edieted it correctly....
(261)(10) if (item.getName().equals("bandage")){
player.sendTextMessage("yes");
}
-
public void PlayerInventoryToChestEvent(PlayerInventoryToChestEvent event){
Player player = event.getPlayer();
final int infoId = event.getChestID();
String Pname = player.getName();
Chest chest = getWorld().getChest(infoId);
//Item item = chest.getItem(1);
Item item = event.getItem();
if (item.getName().equals("bandage")){
player.sendTextMessage("yes");
player.sendTextMessage("no");
Display More
java.lang.NullPointerException
at BootyBay.PlayerInventoryToChestEvent(BootyBay.java:10)
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:883)
at aU.f.messageReceived(SourceFile:119)
at k.e.a(SourceFile:109)
at k.c.run(SourceFile:65)
why does reurn a NULL exeption?
-
I Think it's Strane you can only set the font size in a Label, Not a text Field, and please add Multi-line input
-
I got it, I did my game accountr and had to make a new psssword, i did it four times in order for to finally accept it.
-
I cannot log into stats.rising-world.net I requested a new Password, Made a New JLW account, Tried Every Combinaton of my username and password,
i even Tried my forum Accouint, It keeps knocking me back to the login Screen.
-
ok thats strange, it removes things slowly, but not everything gets cleared, just random things get left in, no errors.
-
public void PlayerInventoryToChestEvent(PlayerInventoryToChestEvent event){
Player player = event.getPlayer();
final int infoId = event.getChestID();
String Pname = player.getName();
Chest chest = getWorld().getChest(infoId);
String query = "SELECT * FROM Money WHERE `User` = '" + Pname + "'";
try (ResultSet result = db.executeQuery(query)){
String User= result.getString("User");
int Amount = result.getInt("Amount");
db.executeUpdate("UPDATE `Money` SET `Amount` = '" + total + "' WHERE `User` = '" + Pname + "' ");
//p.setAttribute("TotAmount", 2000);
player.sendTextMessage("[#ffff00] chest id: " + chest.getID());
Display More
it only works in single player, it clears the chest in singleplayer, but not on the server
-
Inventory Inven = player.getInventory();
Item[] Invent = Inven.getItems(Inventory.SlotType.Inventory);
for(int i = 0; i < 20; i++){
player.sendTextMessage(""+Invent[i].getName());
String Carried = Invent[i].getName();
// player.sendTextMessage("[#FF0000]Found: "+Carried);
if (Carried.equals("cotton")){
player.sendTextMessage("[#FF0000]Found: "+Carried);
else if(Invent[i] !=null){
player.sendTextMessage(""+Invent[i]);
player.sendTextMessage(""+Carried+"[#FF0000] NOT Found: ");
Display More
This Code I posted, when there somethuing that is there, it works Fine, I want it to say "Not Fouind." it Shows the Igtem Info
-
Inventory Inven = player.getInventory();
Item[] Invent = Inven.getItems(Inventory.SlotType.Inventory);
for(int i = 0; i < 20; i++){
// player.sendTextMessage(""+Invent[i]);
player.sendTextMessage(""+Invent[i]);
else if( Invent[i].equals(Pack)){
player.sendTextMessage("[#FF0000]Found: "+Pack);
Display More
how do get the "Name" of the item?
-
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.
-
public void onItemPickUpFromChest(PlayerChestToInventoryEvent event){
Player p = event.getPlayer();
Player player = event.getPlayer();
String GetPlayer = p.getName();
final int infoId = event.getChestID();
Chest chest = getWorld().getChest(infoId);
player.sendTextMessage("[#ffff00] chest id: " + chest.getID());
String query = "SELECT * FROM Money WHERE `User` = '"+GetPlayer+"'";
try (ResultSet result = db.executeQuery(query)){
String User = result.getString("User");
int UAmount = result.getInt("Amount");
p.setAttribute("TotAmount", UAmount);
//p.setAttribute("TotAmount", 2000);
int theAmount = (int) player.getAttribute("TotAmount");
player.sendTextMessage(""+theAmount);
player.sendTextMessage("[#ffff00] Money: "+theAmount);
Item item = event.getItem();
player.sendTextMessage("[#ffff00] Money: "+item);
Item Chestitem = chest.insertNewItem((short) 104,1,1);
Display More
-
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
-
i wes using that evenmt and it sad chest ID 12
-