Tweakeroo

Tweakeroo

2M Downloads

`tweakHandRestock` appears to be incompatible with `tweakPeriodicAttack`.

James103 opened this issue ยท 5 comments

commented

As of Tweakeroo 0.10.0-dev.20210710.155746 and Minecraft 1.17.1, tweakHandRestock appears to be incompatible with tweakPeriodicAttack when the latter is being used to attack Endermen with a stone sword.

To reproduce:

  1. Summon an enderman with infinite effective health: /summon enderman ~ ~ ~ {NoAI:1b,ActiveEffects:[{Id:11b,Amplifier:9b,Duration:2000000000}]}
  2. Give yourself 20 stone swords, each with only a few uses remaining: /give @s stone_sword{Damage:120} 20
  3. /gamemode survival if you are not in survival mode already.
  4. Look at the enderman in its legs or feet.
  5. Hold one of the stone swords.
  6. Turn on tweakHandRestock.
  7. Turn on tweakPeriodicAttack.
  8. Wait a few seconds. You should notice that as the first stone sword breaks, the second stone sword is not automatically swapped in.
commented

It seems like tweakHandRestock does not work on tools, I don't know if this is intended or not

commented

I was just poking around here regarding that. I believe the tweakHandRestock has changed to be either whitelist or blacklist, and by default it's neither.

Check the menu under "Lists" for these settings:
image

commented

Yep - I agree with @KMikeeU. The tweakHandRestock does not apply to tools, even when it's listed in the handRestockWhiteList.

commented

The default list type being None means that there is no restriction. The bug for it not working with periodic attack is elsewhere.

commented

So I looked into this a bit, and the main issue is that the tool items do not break on the client at all now, they only break on the server side and the change in the slot contents is then synced to the client. Thus the hand restock code does not see the item changing after the attack action.

So this would need the handRestockContinuous feature or similar which keeps checking the slot each tick. Although now that I think of it, the server does send the item break event/packet that does the breaking animation and sound, maybe the hand restock could also hook in there...