Closed vortexthedev closed 11 months ago
I was not able to reproduce your issue.
A few thoughts:
)
:
AnvilGUI.ResponseAction.run(() -> player.performCommand("friend add " + state.getText()),
-> AnvilGUI.ResponseAction.run(() -> player.performCommand("friend add " + state.getText())),
, so it won't compile. Even with this fix your code works as expected.player
come from? You should use state.getPlayer()
here.Please provide the full source code to look into this further
public void action(Player player, String text, String command) {
player.closeInventory();
new AnvilGUI.Builder().
onClick((slot, state) -> {
if(slot != AnvilGUI.Slot.OUTPUT)
return Collections.emptyList();
return List.of(
AnvilGUI.ResponseAction.run(() -> player.performCommand(command + " " + state.getText())),
AnvilGUI.ResponseAction.close()
);
}).
itemLeft(new ItemStack(Material.NETHER_STAR)).
title(ChatColor.GREEN + "Enter " + text).
text("Answer").
plugin(YourPlugin.getInstance()).
open(player);
}
There is the code I'm using to open the anvil GUI on the gif which is not working, basically I've copied it from the example that you have provided in the readme.
Have you tried this with only anvilgui running on the server? Looks like a classic conflicting plugin.
So no, you didn't do that? You sent a picture with 15 plugins loaded.
Add me to Discord please: @vortex2252
Doesn`t work at all for me using 1.19.4, 1.20.1, 1.20.2 versions. My code: