Patbox / TextPlaceholderAPI

Placeholder API for Fabric
GNU Lesser General Public License v3.0
38 stars 17 forks source link

Having issues with click:open_url #53

Closed KoertLichtendonk closed 7 months ago

KoertLichtendonk commented 7 months ago

Why does

return PlaceholderResult.value("<hover:Click here to go to profile of "+ player.getName().getString() +" ("+ profileName +")!>"+ profileName +"</hover>");

work, but

return PlaceholderResult.value("<click:open_url:"+ profileURL +">"+ profileName +"</click>");

not? Once I add a click event, the Placeholder just doesn't work anymore, nothing shows up. What am I doing wrong?

My placeholder registration

        Placeholders.register(new Identifier("webpage", "profile"), (ctx, arg) -> {
            if (!ctx.hasPlayer())
                return PlaceholderResult.invalid("No player!");

            ServerPlayerEntity player = ctx.player();
            String profileName = "MyCoolProfileName";
            String profileURL = "https://localhost/"+ profileName;
            return PlaceholderResult.value("<click:open_url:"+ profileURL +"><hover:Click here to go to profile of "+ player.getName().getString() +" ("+ profileName +")!>"+ profileName +"</hover></click>");
        });