[SPIGOT-7029] player.openEnchanting() not working Created: 05/Jun/22 Updated: 25/Dec/24 |
|
| Status: | Open |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Fish Bird | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | bug | ||
| Environment: |
Running on Windows 11 laptop with no other plugins installed. |
||
| Attachments: |
|
| Version: | CraftBukkit version 3493-Spigot-b081915-9d46b56 (MC: 1.18.2) |
| Guidelines Read: | Yes |
| Description |
|
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 |
| Comments |
| Comment by BlockyTheDev [ 27/Jan/23 ] |
|
@md_5 Maybe by adding a parameter to the method set the level, so that it has a level? |
| Comment by md_5 [ 05/Jun/22 ] |
|
It's difficult to open an enchanting table with no block because how do you calculate the level from nearby bookshelves etc. |