`tweakHandRestock` appears to be incompatible with `tweakPeriodicAttack`.
James103 opened this issue ยท 5 comments
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:
- Summon an enderman with infinite effective health:
/summon enderman ~ ~ ~ {NoAI:1b,ActiveEffects:[{Id:11b,Amplifier:9b,Duration:2000000000}]}
- Give yourself 20 stone swords, each with only a few uses remaining:
/give @s stone_sword{Damage:120} 20
/gamemode survival
if you are not in survival mode already.- Look at the enderman in its legs or feet.
- Hold one of the stone swords.
- Turn on
tweakHandRestock
. - Turn on
tweakPeriodicAttack
. - Wait a few seconds. You should notice that as the first stone sword breaks, the second stone sword is not automatically swapped in.
It seems like tweakHandRestock does not work on tools, I don't know if this is intended or not
Yep - I agree with @KMikeeU. The tweakHandRestock
does not apply to tools, even when it's listed in the handRestockWhiteList
.
The default list type being None means that there is no restriction. The bug for it not working with periodic attack is elsewhere.
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...