Posted August 12, 20169 yr I want to prevent all animations that happen when the left mouse button is pressed. The problem that I can't find a way to prevent the up-and down movement of the item when the item "recharges". The feature was introduced in 1.9 (I think) and is indicated with a little sword below the crosshair. Edit: solved by overriding Item::getAttributeModifiers @Override public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(slot, stack); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", 1024, 0)); return multimap; }
August 12, 20169 yr Author If you put the item in the off-hand and back in the main-hand the cooldown is back until you switch to a different item (or update the stack somehow else) Is there an event that is thrown when switching items between hands? Also the tooltip of the item now shows 1014 as attackspeed. My second approach is to set the SharedMonsterAttributes.ATTACK_SPEED of the player as high as possible when the item is held because it is used to calculate attack speed of the player (EntityPlayer::getCooledAttackStrength) and then set it back to 4 when a different item is held. This is really hackey and exactly what I wanted to prevent by using the new rendering system but it's better than nothing.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.