[Solved]Give compass

Bonjour, j’aimerais give une boussole avec pour nom “SimonBHB” et qu’elle indique une autre position que le Spawn, mais la boussole n’a jamais le bon nom:

Google trad:
Hello, I would like to give a compass with the name “SimonBHB” and indicates a position other than the Spawn, but the compass never has the good name:

ItemStack.Builder builder = Sponge.getGame().getRegistry().createBuilder(ItemStack.Builder.class);
builder.itemType(ItemTypes.COMPASS).quantity(1).keyValue(Keys.DISPLAY_NAME, Text.of("SimonBHB")).keyValue(Keys.TARGETED_LOCATION, vector3d);
ItemStack stack = builder.build();
player.getInventory().offer(stack);

Merci

What version of Sponge are you testing on?
I know there was a fix for ItemStack.Builder#keyValue a while ago

spongeforge-1.8.9-1808-4.1.0-BETA-1265 ?

J’ai mit spongeforge-1.8.9-1808-4.1.0-BETA-1303 et problème résolu merci!!! Par contre ça marche pas pour TARGETED_LOCATION ça indique toujours le spawn

Google trad:
I began spongeforge-1.8.9-1808-4.1.0-BETA-1303 and problem solved thank you !!! By cons it does not work for TARGETED_LOCATION it always shows the spawn

Keys.TARGETED_LOCATION isn’t actually applicable for a compass.
Due to the way minecraft works internally, the target location is a property on the player (not compass).

So instead, you’ll have to offer the data to a player object instead.

i.e. player.offer(Keys.TARGETED_LOCATION, vector3d)

Le problème c’est que plus aucune boussole pointe vers le spawn!

Google trad:
The problem is that no more compass points to the spawn!

Correct, this is a limitation of vanilla minecraft.
All compasses will point to the same place.