hi,
when i use this function :
i have a error when itemstack.offer()
i look the method of essentialsCMD and CraftBook and it’s doesn’t work.
hi,
when i use this function :
i have a error when itemstack.offer()
i look the method of essentialsCMD and CraftBook and it’s doesn’t work.
This is overcomplicated on many levels, try this for size:
public ItemStack createPlayerHead(GameProfile game) {
ItemStack skull = ItemStack.of(ItemTypes.SKULL, 1);
if (skull.offer(Keys.REPRESENTED_PLAYER, game).isSuccessful()) {
this.plugin.getEServer().broadcast("offer : success");
} else {
this.plugin.getEServer().broadcast("offer : error");
}
return skull;
}
this method give a skeleton head’s
the key “REPRESENTED_PLAYER” doesn’t work for a SkullTypes.PLAYER
i found the problem, in this class “SkullTypeRegistryModule” the player skull is register in id = 3 and when i execute this this.skullTypeMap.put(“player”, new SpongeSkullType((byte) 3, “player”));
Iterables.get(SpongeImpl.getRegistry().getAllOf(SkullType.class), 3) => SkullTypes.CREEPER
Aaron1011 has just corrected the problem :