So I want to get the chest's inventory and add some items into it....however, the last line of code is spitting out errors! Can someone help out? Code:java if(kills.get(killer.getName()) == 3){ Location chestlocation = new Location(killer.getWorld(), killer.getLocation().getX(), killer.getLocation().getY() + 2, killer.getLocation().getZ()); chestlocation.getBlock().setType(Material.CHEST); Chest chest = (Chest) chestlocation.getBlock().getState(); chest.getInventory().addItem(new ItemStack(Material.ANVIL));
adam753 http://pastebin.com/kLKZvyM8 Can anyone figure this out? I've literally been struggling for hours.. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
MoeMix It means that the server was still running when you compiled it to the folder. At least make sure that thej ar is updated.
xTrollxDudex yeah it is updated. I made sure I stopped the server, delete the old jar, and export the new one.
MoeMix Dang! I didn't read the stacktrace correctly. You have the wrong import, you need to cast to org.bukkit.block.Chest. NOT org.bukkit.material.Chest.