setTicksLived not working

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • Environment:

      Windows 10

      Spigot 1.11.2

      Items despawn after 6000 ticks regardless of setTicksLived.

      In the code example, I want an item to live for 3 seconds before despawning. I check 4 seconds after spawning it, and it's still alive, with its ticks lived being 6020 rather than having despawned at 6000 like it's supposed to.

      To replicate:

      Item item = LocationUtils.end.dropItem(<wherever>, newStack);
      item.setTicksLived(6000 - (3 * 20));
      
      main.getServer().getScheduler().scheduleSyncDelayedTask(main, new Runnable()
      {
          @Override
          public void run()
          {
              Bukkit.getServer().broadcastMessage("" + item.getTicksLived()); // returns 6020, item is still alive
          }
      }, 4 * 20);
      

            Assignee:
            Unassigned
            Reporter:
            Ricky Fisher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: