#use anvil gui to take a string

1 messages · Page 1 of 1 (latest)

lone cove
#

Hello i am trying to get a string but i dont want to make it over chat and my only other idea is the anvil gui but its a litle bit buggy because it doesn´t work correctly it opens but i cant type anything and i cant place items ingame or over code

toxic iron
#

you could make it via sign

#

alltough anvil should work

#

no idea why it wouldnt

lone cove
#

sign is a good idea thank i think i make it so when i add a item manual i was kicked with error packet proccessing error and i cant type anything in the anvil

toxic iron
#

lemme think, this should definetly be possible

#

problem is if you create and then add the item in I guess

#

because someone else putting an item in an anvil is normally not possible

lone cove
#

i already try to place items in it with code but it doesnt work
the code i try:
p = player
Inventory createnew = Bukkit.createInventory(p, InventoryType.ANVIL, "§6LootChest || Name");

    ItemStack name = new ItemStack(Material.NAME_TAG);
    ItemMeta nameMeta = name.getItemMeta();
    nameMeta.setDisplayName("Enter name of the chest!");
    name.setItemMeta(nameMeta);
    
    createnew.addItem(name);
    
    createnew.setItem(0, name);
    
    p.openInventory(createnew);
#

i think i cant type bc it is no item in it i see but i cant add manual an item not not with code

covert kindle
#

what does that mean?

lone cove
#

it doesnt give me any error in console and there is no item in the anvil gui

covert kindle
#

use the inventoryclickevent and print out the actual slot number of the slot that you want to change

#

it's probably not slot 0

lone cove
#

but the problem when i click in the slot i got kicked with the error: packet proccessing error

covert kindle
#

erm pls show the code that makes you get kicked

lone cove
#

i only create the inventory with the code:
p = player
Inventory createnew = Bukkit.createInventory(p, InventoryType.ANVIL, "§6LootChest || Name");

    ItemStack name = new ItemStack(Material.NAME_TAG);
    ItemMeta nameMeta = name.getItemMeta();
    nameMeta.setDisplayName("Enter name of the chest!");
    name.setItemMeta(nameMeta);

    createnew.addItem(name);

    createnew.setItem(0, name);

    p.openInventory(createnew);

and i open it with a command and then i get kicken when i click in the slots with the erro packet proccessing error
(when i set no item it is the same)
my english is not the best sorry

covert kindle
#

take a look at this