Library Holographic Displays v2: an easy way to manage holograms (+ power ups)

Discussion in 'Resources' started by filoghost, May 19, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    MrDplugins

    filoghost Question How would one remove a floating item? I tried a bukkit Runnable but floatingItem.delete(); removes the item stack and does not change the Melon Block into a Melon Slice.
     
  2. Offline

    filoghost

    MrDplugins why removing a melon block icon should turn it into slices?
     
  3. Offline

    MrDplugins

    filoghost that was the code that It spawns a Melon Block then after 10 seconds its changes into a slice im saying it skips the changing into a slice and immeditely deltes the melon after 10 seconds and the melon slice does not appear.
     
  4. Offline

    filoghost

    Can I see the code?
     
  5. Offline

    MrDplugins

    filoghost https://github.com/filoghost/HolographicDisplays/wiki/Floating-items there is the link for your code and here is the code I'm running
    Code:
              Location loc = e.getPlayer().getLocation().add(0.0, 2.0, 0.0);
              ItemStack itemStack = new ItemStack(Material.MELON_BLOCK);
              final FloatingItem floatingItem1 = HolographicDisplaysAPI.createFloatingItem(plugin, loc, itemStack);
     
              new BukkitRunnable() {
                  @Override
                  public void run() {
                      floatingItem1.setItemStack(new ItemStack(Material.MELON));
                  }
              }.runTaskLater(plugin, 10 * 20);
             
              new BukkitRunnable() {
                  @Override
                  public void run() {
                      floatingItem1.delete();
                  }
              }.runTaskLater(plugin, 10 * 20);
             
              }
     
  6. Offline

    filoghost

    In my code I'm not deleting the item... the problem is that you're changing it and deleting it at the same time, you have two tasks that are executed 10 seconds later, but in the same exact moment.
     
  7. Offline

    filoghost

    The API will be soon expanded, v2 soon!
     
    LCastr0 likes this.
  8. Offline

    filoghost

    Updated for the upcoming v2.
     
  9. Offline

    Shawckz

    err whats new in v2?
     
  10. Offline

    filoghost

  11. Offline

    Shawckz

  12. Offline

    filoghost

    No, sorry. A standalone hologram class wouldn't be multiversion and must be updated manually, using an API is much easier.
     
Thread Status:
Not open for further replies.

Share This Page