NachoSpigot icon indicating copy to clipboard operation
NachoSpigot copied to clipboard

TNTPrimed setCustomName does not refresh.

Open Happy-FZM opened this issue 3 years ago • 2 comments

Observed Behavior

I want to use this method to show the explosion time of TNT. However, if the player does not use the right click with the TNT entity, it's name will not be update. The issue seems to exist only in TNT.

Code:

TNTPrimed tnt = e.getBlock().getLocation().getWorld().spawn(e.getBlock().getLocation().add(0.5, 0, 0.5), TNTPrimed.class);
tnt.setFuseTicks(45);
tnt.setCustomNameVisible(true);
new BukkitRunnable() {
    @Override
    public void run() {
        tnt.setCustomName("§c" + (tnt.getFuseTicks() / 20.0) + " s");
        if (!tnt.isValid() || tnt.getFuseTicks() <= 0) {
            cancel();
        }
    }
}.runTaskTimer(plugin, 0, 1);

Expected Behavior

TNT's name will be refresh when the tick update.

Steps To Reproduce

Execute the code.

Plugin List

No response

Server Version

This server is running NachoSpigot version git-NachoSpigot-"f526249" (MC: 1.8.8) (Implementing API version 1.8.8-R0.2-SNAPSHOT)

Other

No response

Agreements

  • [X] You were able to find this issue on the latest version of NachoSpigot.
  • [X] You have confirmed that there aren’t any issues open regarding this bug.

Happy-FZM avatar Mar 13 '22 11:03 Happy-FZM

Looks like it's related to 'faster-cannon-tracker' option. With that option enabled metadata is sent only when TNT is changing position. Most likely that's the problem

outofmem13 avatar Apr 11 '22 17:04 outofmem13

Observed Behavior

I want to use this method to show the explosion time of TNT. However, if the player does not use the right click with the TNT entity, it's name will not be update. The issue seems to exist only in TNT.

As @outofmem13 said, disabling faster-cannon-tracker should fix this issue

ghost avatar Apr 17 '22 18:04 ghost