Minecraft colored banners placed with Java?

Za
- in Worlds
3

I'm currently programming a Minecarft plugin in Spigot 1.8.8. Now I want to put a red banner just don't know how. I know how to place normal banners but not how to place colored ones. So far my code looks like this:

public void setBanner () {

World world = Bukkit.getWorld ("world");

Location locred = new location (world, 198, 63, 562);

world.getBlockAt (locred) .setType (Material.STANDING_BANNER);

}

Can anyone help me further?

Co

You have to enter the SubId behind as bytes. According to the material (byte) subid

Za

Thank you very much for the answer! I used to propose for a long time but it doesn't work. The subid apparently only works with ItemStacks. When I write the following code: world.getBlockAt (locred) .setType (Material.STANDING_BANNER, (byte) 14);

is undermined setType. Do you have another option? I have already proposed it with DyeColor.RED.getDyeData ().

Co

Mhh just ask me why everyone uses 1.8, it is completely out of date