-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
Environment:
Running on Windows 11 laptop with no other plugins installed.
-
CraftBukkit version 3493-Spigot-b081915-9d46b56 (MC: 1.18.2)
-
Yes
I have the following code:
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { Player player = (Player) sender; player.openEnchanting(null, true); return true; }
This is expected to open the enchanting table for the player that types the command (the command is /test in the test plugin, which I attached). However, it does not unless the player is standing directly on top of the enchanting table.
I tried changing the first argument to "player.getLocation()" and the second argument to "false", but neither of these worked.
There is a spigot thread (created by someone else) about this here: https://www.spigotmc.org/threads/openenchanting-method-does-nothing.559286/#post-4420911