[SPIGOT-7454] Player#openSign cannot open from far away Created: 10/Aug/23  Updated: 25/Dec/24  Resolved: 17/Aug/23

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Shane Bee Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None

Issue Links:
Cloners
clones SPIGOT-7452 Player#openSign cannot edit Resolved
Version: CraftBukkit version 3853-Spigot-3bce793-d91e5aa (MC: 1.20.1)
Plugin: just the included test plugin
Guidelines Read: Yes

 Description   

I noticed recently when using Player#openSign, the player can no longer edit.
There is kind of 2 issues here.

With the included jar file, I will explain the two issues
setup:

  • place a sign down in the world
  • while looking at the sign, run command "/test set" (this just caches the block for later)
  •  

Issue #2 - can't open from far away:

  • move about 20(ish) blocks away from the sign in any direction
  • run command "/test open" (the sign will not open, you may see it open for a tick and close immediately)
  • In console you shall see:
    "Player <YourName> just tried to change non-editable sign"

test code (which is in the provided plugin):

@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
    if (sender instanceof Player player && args.length == 1) {
        if (args[0].equalsIgnoreCase("set")) {
            block = player.getTargetBlockExact(50);
        } else if (args[0].equalsIgnoreCase("open")) {
            if (block != null && block.getState() instanceof Sign sign) {
                player.openSign(sign);
            }
        }
    }
    return true;
}


 Comments   
Comment by Shane Bee [ 13/Aug/23 ]

we can close this.

After digging thru the client code, I've come to the conclusion the client handles the distance.
Most likely a safety measure they added into the client.
Nothing the server can do about it!

Generated at Tue Apr 22 05:22:31 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.