STANDING_BANNER help

Discussion in 'Plugin Development' started by kelquethas, Apr 10, 2019.

  1. Offline

    kelquethas

    how to adjust the color in the STANDING_BANNER ?


    Code:
                            
    ItemStack i = new ItemStack(Material.STANDING_BANNER);
    BannerMeta im = (BannerMeta) i.getItemMeta();
    im.setBaseColor(DyeColor.LIGHT_BLUE);
    im.addPattern(new Pattern(DyeColor.YELLOW, PatternType.HALF_HORIZONTAL));
    i.setItemMeta(im);
    p.getLocation().getWorld().getBlockAt(p.getLocation()).setType(i.getType());


    Code:
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[patched.jar:git-TacoSpigot-1be69cbf]
            at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) ~[patched.jar:git-TacoSpigot-1be69cbf]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched.jar:git-TacoSpigot-1be69cbf]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:525) ~[patched.jar:git-TacoSpigot-1be69cbf]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:510) ~[patched.jar:git-TacoSpigot-1be69cbf]
            at com.codingforcookies.moreevents.wg.WGRegionEventsListener.lambda$updateRegions$6(WGRegionEventsListener.java:153) ~[?:?]
            at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) [patched.jar:git-TacoSpigot-1be69cbf]
            at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:349) [patched.jar:git-TacoSpigot-1be69cbf]
            at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:785) [patched.jar:git-TacoSpigot-1be69cbf]
            at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-TacoSpigot-1be69cbf]
            at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:715) [patched.jar:git-TacoSpigot-1be69cbf]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:618) [patched.jar:git-TacoSpigot-1be69cbf]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.BannerMeta
    
     
  2. Offline

    KarimAKL

    @kelquethas I think you should use 'Material.BANNER', not 'Material.STANDING_BANNER'.
     
  3. Offline

    kelquethas

Share This Page