Open verbuchselt opened 1 year ago
I'm pretty sure this is also the vanilla behavior tho?
Why though? It seems that this is unintended behaviour, doesn't it? I'll try to replicate this in vanilla and probably file a bug report for Minecraft.
Tested it both in vanilla and on Paper using vanilla commands and it seems to work just fine. It must have something to do with either Adventure components or Paper.
Oh, I thought you were talking about the score on a sign not being updated upon modifying the score itself. Although, if you're changing a sign with the vanilla command, it seems that score component is automatically "translated" to text component. Same happens when you're placing a sign with score component. Maybe the client itself cannot render score components on a sign?
P.s. Tested the stuff using sign generator and by looking at /data get block x y z
output.
Have you also tried to resolve the component, sometimes the server is lazy. Something like:
@EventHandler
public void on(PlayerItemHeldEvent e) {
var player = e.getPlayer();
var block = player.getTargetBlockExact(10);
if (BlockTags.SIGNS.isTagged(block.getBlock())) {
Sign sign = (Sign) block.getState();
try {
sign.line(0, PaperComponents.resolveWithContext(MiniMessage.miniMessage().deserialize("<score:Lulu13022002:DamageDealt/>"), player, null, false));
sign.update();
} catch (IOException ex) {
// do something
}
}
}
Oh, I thought you were talking about the score on a sign not being updated upon modifying the score itself. Although, if you're changing a sign with the vanilla command, it seems that score component is automatically "translated" to text component. Same happens when you're placing a sign with score component. Maybe the client itself cannot render score components on a sign?
P.s. Tested the stuff using sign generator and by looking at
/data get block x y z
output.
Haven't realised, that this is also an issue for me.. I actually want to have the compontent be rendered client-side and didn't know that scoreboard values get converted by the server... feels a bit silly to me :-(
See above, components need to be resolved, they are not done automatically.
Open for more feedback, whether sign components should be automatically resolved as it's currently done on load.
Expected behavior
When creating a Adventure score component and putting it onto a sign, it should display the score immediately upon update.
Observed/Actual behavior
The sign will change the component without rendering a score number. Only when then cloning the sign with nbt, using middle click, and placing it as a new block, the component is rendered properly.
Steps/models to reproduce
In this example, I created a command, using the CommandAPI, that interpretes MiniMessage, but it will behave the same way, when directly manipulating a sign on a hardcoded location and without interpreting MiniMessage or executing a command.
You can see the behaviour in this video: https://youtu.be/TK64-E8hQAQ
Plugin and Datapack List
Paper version
Other
I already discussed this issue with the folks of Kyori and they noted that this is probably an issue with the implementing platform.