Hello !
I would like to ask you a question about Banners. I’m trying to give players a Banner (ItemStack) of a specific color. Here is what I do:
ItemStack item = ItemStack.builder().itemType( ItemTypes.BANNER ).build();
item.offer(Keys.DYE_COLOR, DyeColors.RED);
But I always get a black banner (default color). Here is what I also tried:
- Other keys such as
Keys.DISPLAY_NAME, Keys.LORE
etc. are perfectly applied to the item - The key
Keys.DYE_COLOR
works on wool blocks - The keys
Keys.COLOR
andKeys.BANNER_BASE_COLOR
don’t work either
And what is really strange is that I manage to set a colored banner as a TileEntity:
location.setBlockType(BlockTypes.STANDING_BANNER, ...);
Optional<TileEntity> optBanner = location.getTileEntity();
if(optBanner.isPresent())
{
Banner banner = (Banner) optBanner.get();
banner.offer(banner.baseColor().set(DyeColors.RED));
}
Please let me know if I did something wrong !