When using an item with stats attack damage, the player is unable to attack entities empty-handed.
Summary
I've tested it over and over again, and when a weapon with stats on it's attack damage attribute attacks the target, the player can't attack the entity empty-handed.
Steps to reproduce
Current behavior
[12:27:37 INFO]: MagicMakes issued server command: /mm menu [12:27:46 WARN]: [MythicMobs] ItemFlag 'HIDE_POTION_EFFECTS' does not exist in >=1.20.5. [12:27:46 WARN]: [MythicMobs] ItemFlag 'HIDE_POTION_EFFECTS' does not exist in >=1.20.5. [12:27:46 WARN]: [MythicMobs] ItemFlag 'HIDE_POTION_EFFECTS' does not exist in >=1.20.5. [12:27:47 WARN]: [MythicMobs] ItemFlag 'HIDE_POTION_EFFECTS' does not exist in >=1.20.5. [12:27:47 WARN]: [MythicMobs] ItemFlag 'HIDE_POTION_EFFECTS' does not exist in >=1.20.5. [12:27:47 WARN]: [MythicMobs] ItemFlag 'HIDE_POTION_EFFECTS' does not exist in >=1.20.5. [12:27:48 ERROR]: [MythicMobs] [EVENTS] Exception thrown whilst handling event: io.lumine.mythic.bukkit.events.MythicStatChangeEvent [12:27:48 WARN]: java.lang.NullPointerException: Cannot invoke "org.bukkit.attribute.AttributeInstance.setBaseValue(double)" because the ret urn value of "org.bukkit.entity.LivingEntity.getAttribute(org.bukkit.attribute.Attribute)" is null [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.adapters.BukkitEntity.setAttackSpeed(BukkitEnti ty.java:828) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.skills.stats.types.VanillaAttackSpeedStat.lambda$ load$1(VanillaAttackSpeedStat.java:22) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.utils.Delegates$ConsumerToBiConsumerSecond.acce pt(Delegates.java:144) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.utils.events.functional.single.EventListener.ex ecute(EventListener.java:131) [12:27:48 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) [12:27:48 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [12:27:48 WARN]: at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) [12:27:48 WARN]: at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) [12:27:48 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.utils.Events.call(Events.java:103) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.skills.stats.StatRegistry$StatMap.calculateCached Value(StatRegistry.java:252) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.skills.stats.StatRegistry$StatMap.setBaseValue(St atRegistry.java:214) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.skills.stats.StatRegistry$StatMap.(StatRegi stry.java:209) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.skills.stats.StatRegistry.compute(StatRegistry.ja va:48) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.skills.stats.StatRegistry.(StatRegistry.jav a:41) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.mobs.ActiveMob.(ActiveMob.java:137) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.mobs.MobType.spawn(MobType.java:965) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.mobs.MobType.spawn(MobType.java:912) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.mobs.MobType.spawn(MobType.java:899) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.core.mobs.MobType.spawn(MobType.java:887) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.listeners.EggListeners.onEggInteract(EggListene rs.java:80) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.utils.Delegates$ConsumerToBiConsumerSecond.acce pt(Delegates.java:144) [12:27:48 WARN]: at MythicMobs-5.7.0-SNAPSHOT-Build 5126.jar//io.lumine.mythic.bukkit.utils.events.functional.single.EventListener.ex ecute(EventListener.java:131) [12:27:48 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) [12:27:48 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) [12:27:48 WARN]: at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) [12:27:48 WARN]: at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) [12:27:48 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) [12:27:48 WARN]: at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:593) [12:27:48 WARN]: at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:533) [12:27:48 WARN]: at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:2010) [12:27:48 WARN]: at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:44) [12:27:48 WARN]: at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:11) [12:27:48 WARN]: at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55) [12:27:48 WARN]: at net.minecraft.server.TickTask.run(TickTask.java:18) [12:27:48 WARN]: at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) [12:27:48 WARN]: at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1546) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195) [12:27:48 WARN]: at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1523) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1446) [12:27:48 WARN]: at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1412) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1273) [12:27:48 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) [12:27:48 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
Intended correct behavior
There will be no problem attacking entities after using items with stats attributes.
Server log file
Debug log snippet
Proposed fixes