#Head rename too many packets

1 messages · Page 1 of 1 (latest)

knotty mango
#

Here is a gif

#

each head only does it after like 2-3 renames

knotty mango
#

update

#

the problem seems to not be mine

#

could it be viaver?

#

nope

wispy island
#

Im guessing this only happens when you are in creative?

knotty mango
#

Uh no actually

#

or wait

#

ill test in surv

#

@wispy island nope

#

its both creative and surv

#

the message above the thread's message is my code

#

What i am trying to do:

Whenever my custom skull is renamed, it will set its owner to the name of the skull, now this works, however after a couple times you do this it will go crazy and kick the player for too many packets, here's my current code:

@EventHandler
public void on(PrepareAnvilEvent event) {
    ItemStack result = event.getResult();
    if(result == null) return;
    if(result.getType() == Material.PLAYER_HEAD) {
        SkullMeta meta = (SkullMeta) result.getItemMeta();
        OfflinePlayer player = Bukkit.getOfflinePlayer(meta.getDisplayName());
        meta.setOwningPlayer(player);
        result.setItemMeta(meta);
    }
}
```(I still need to add the check for my skull, however its just easier to test without it)

That message
wispy island
#

This is really weird and ive never seen that.
The fact that its happening for other heads too is interesting.

knotty mango
#

the fun thing is

#

i commented the code out

#

and it still happens

#

i made sure maven had actually compiled

#

because sometimes it doesn't

wispy island
#

Yea i dont think this listener would have any effects on that

knotty mango
#

yeah

#

I only listen to:

BlockPlaceEvent
PlayerJoinEvent
EntityDamageByEntityEvent