DualWield

A simple lightweight plugin to allow you to fully use tools and weapons in the off-hand, this includes mining and attacking!​

 

Compatibility:
This plugin should be compatible with all protection plugins, plugins that cancel entity damage events and block break events. It should also be compatible with a majority of third party enchantment plugins and even plugins like McMMO. Attacking with an off-hand weapon uses a modified version of Mojangs own attack code so it should react and behave exactly like a a weapon in the main hand! Tools that mine blocks are virtually the same speed as in the main hand, normal enchantments also work. 1.8 PvP plugins are also compatible. Attacking still has a cooldown but it is impossible to show the animation as it is client side.

Attacking with the off-hand


Mining with the off-hand


Attack Cooldown Time:
When you attack with the off-hand the same code is used to calculate the damage as when attacking normally, this includes accounting for spam clicking and cooldown time on attacks. Other plugins that change the attack speed to remove the cooldown will also automatically take effect in the off-hand too!

Attack Cooldown Animation:
When attacking with the off-hand players may think that there is no cooldown and they can spam hit since the animation does not play, but in fact the cooldown is taken into account when calculating the damage. It is impossible to play the animation to the player as it's completely client side.

Permissions:
dualwield.attack (Default)
dualwield.mine (Default)

API:
The API allows you to check if if the BlockBreakEvent and EntityDamageByEntityEvent event were created by using an off-hand action.

 

For plugin compatibility, for the duration of the events that fire from mining and attacking the items in the players main-hand and off-hand are switched. This will allow plugins that use getItemInMainHand to get the correct item, we also put some NBT data on the item when it is in the off-hand so we can check in EntityDamageByEntityEvent and BlockBreakEvent if it was created using an off-hand item. When using the API it's recommended to use dualWieldAPI.getItemInMainHand(player) rather player.getItemInMainHand(). This is because the main-hand item is really the off-hand and the off-hand is really the main-hand, the NBT data also is removed from the item when you get it using the API.

About This Project

  • Project ID
    531666
  • Created
    Sep 26, 2021
  • Last Released File
    Oct 9, 2021
  • Total Downloads
    680
  • License

Categories

Members

Recent Files