Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3234

setTicksLived not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • None
    • None
    • 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);
      

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

              Created:
              Updated:
              Resolved: