Zrips / CMI

114 stars 97 forks source link

[Bug] Attached commands do not work on custom items #8926

Open jtwebhomer opened 1 month ago

jtwebhomer commented 1 month ago

Description of Issue

I am using oraxen to add custom items with custom models to my server, for example i made a stick that has a wand model and texture, when i try to attach a command to the wand for example /attachcommand !limiteduse:100!;;!right!!cc! shoot [playername] -t:[interactedEntity] smallfireball ;;!left!!cc! shoot [playername] -t:[interactedEntity] smallfireball

it works for me, but if i hand the wand to another player it will not work, and then if it is handed back to me it no longer works for me either it also gives an error in the console as seen in the error section of the report

commands attached to vanilla items work fine

Version Information

9.7.4.4 CMI
1.5.0.5 CMI LIB
paper2258

Errors

[21:16:55 ERROR]: Could not pass event PlayerInteractEvent to CMI v9.7.4.4
java.lang.IllegalArgumentException: The found tag instance (ListTag) cannot store List
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:445) ~[guava-32.1.2-jre.jar:?]
        at org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry.extract(CraftPersistentDataTypeRegistry.java:348) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at io.papermc.paper.persistence.PaperPersistentDataContainerView.get(PaperPersistentDataContainerView.java:63) ~[purpur-1.21.jar:?]
        at CMILib.jar/net.Zrips.CMILib.PersistentData.CMIPersistentDataContainer.getListString(CMIPersistentDataContainer.java:304) ~[CMILib.jar:?]
        at CMILib.jar/net.Zrips.CMILib.NBT.CMINBT.getList(CMINBT.java:651) ~[CMILib.jar:?]
        at CMILib.jar/net.Zrips.CMILib.NBT.CMINBT.getList(CMINBT.java:632) ~[CMILib.jar:?]
        at CMI.jar/com.Zrips.CMI.Modules.AttachedCommands.CustomNBTListener.containsConsume(CustomNBTListener.java:424) ~[CMI.jar:?]
        at CMI.jar/com.Zrips.CMI.Modules.AttachedCommands.CustomNBTListener.processInteract(CustomNBTListener.java:151) ~[CMI.jar:?]
        at CMI.jar/com.Zrips.CMI.Modules.AttachedCommands.CustomNBTListener.playerInteractCommand(CustomNBTListener.java:61) ~[CMI.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor130.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:1.21-2258-ff19bcc]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:595) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:551) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:546) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:542) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItem(ServerGamePacketListenerImpl.java:2017) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.network.protocol.game.ServerboundUseItemPacket.handle(ServerboundUseItemPacket.java:47) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.network.protocol.game.ServerboundUseItemPacket.handle(ServerboundUseItemPacket.java:10) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:36) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1576) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1553) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1546) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1505) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1512) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1357) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:332) ~[purpur-1.21.jar:1.21-2258-ff19bcc]
        at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]

Relevant Config Sections

No response

Relevant Plugins

oraxen 1.178.0

Agreements

Zrips commented 1 month ago

What method are you using to pass over items? And does this issue apply to vanilla items not modified or handled by oraxen?

jtwebhomer commented 1 month ago

i am giving the item to another player by selecting the item in the hotbar and pressing q to throw it to them......no this does not affect vanilla items just items added by oraxen

Zrips commented 1 month ago

This sounds more like Oraxen does something with items when you drop/pick one of theirs. CMI isn't using anything too special, just records CMI related data to Persistent data container, which is normal behavior. You will need to get in contact with them to resolve this issue on their end as they are modifying item stack in some inappropriate way which messes things up.