Solved Get name of map in mapinitializeevent

Discussion in 'Spigot Plugin Development' started by craterhater, May 30, 2017.

  1. Hey there!

    How would I get the ItemStack of the map being rendered in this event?

    Code (Text):
    @EventHandler
        public void mapRender(MapInitializeEvent event){
            for(MapRenderer mr : event.getMap().getRenderers()){
                event.getMap().removeRenderer(mr);
            }
        }
     
  2. All I could find was this
    https://bukkit.org/threads/mapview-to-itemstack.212039/
     
    • Useful Useful x 1
  3. Due to Minecraft being mainly singlethreaded, you should just be able to store the name before creating the new MapView and accessing the field when the event is fired.