You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hello, I am in the process of updating my NPC plugin. I also make Fake players appear on my map. Before I used NAMED_ENTITY_SPAWN and apparently I have to use SPAWN_ENTITY from now on since version 1.20.4.
[16:40:17 WARN]: [GaspeziaNPCs] Plugin GaspeziaNPCs v1.9.0 generated an exception while executing task 882java.lang.IllegalStateException: Unable to set value of field private final net.minecraft.world.entity.EntityTypes net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity.eat com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor.set(DefaultFieldAccessor.java:44) ~[ProtocolLib.jar:?]at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:358) ~[ProtocolLib.jar:?]at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:321) ~[ProtocolLib.jar:?]at fr.hotmail.regisgaia.gnpcs.packets.NPCsPC.createPacketNES(NPCsPC.java:101) ~[GNPCs-1.9.0.jar:?]at fr.hotmail.regisgaia.gnpcs.packets.SenderPacketsPlayer.sendSpawnPackets(SenderPacketsPlayer.java:75) ~[GNPCs-1.9.0.jar:?]at fr.hotmail.regisgaia.gnpcs.entities.FakePlayerData.spawn(FakePlayerData.java:73) ~[GNPCs-1.9.0.jar:?]at fr.hotmail.regisgaia.gnpcs.entities.NPCsManager.spawnNPCforPlayer(NPCsManager.java:189) ~[GNPCs-1.9.0.jar:?]at fr.hotmail.regisgaia.gnpcs.entities.NPCsManager.spawnNPCs(NPCsManager.java:160) ~[GNPCs-1.9.0.jar:?]at fr.hotmail.regisgaia.gnpcs.player.PlayerManager.lambda$sendNPCs$0(PlayerManager.java:37) ~[GNPCs-1.9.0.jar:?]at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.4.jar:git-Paper-454]at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.4.jar:git-Paper-454]at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.4.jar:?]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]at java.lang.Thread.run(Thread.java:833) ~[?:?]Caused by: java.lang.ClassCastException: Cannot cast java.lang.Integer to net.minecraft.world.entity.EntityTypesat java.lang.Class.cast(Class.java:3889) ~[?:?]at com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor.set(DefaultFieldAccessor.java:41) ~[ProtocolLib.jar:?]... 14 more
It seems that the expected type is not a VarInt but in EntityTypes. I didn't manage to go any further.
If anyone could help me I would be very grateful.
I use the Paper version git-Paper-454 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 99a6416) with the last build of Protocolibs 5.2.0-SNAPSHOT-679.
Hi,
maybe use the following:
nesPacket.getEntityTypeModifier().write(0, entity.getType()); (where entity is any player...)
and don't write drectly to "2"
Describe the bug
Hello, I am in the process of updating my NPC plugin. I also make Fake players appear on my map. Before I used NAMED_ENTITY_SPAWN and apparently I have to use SPAWN_ENTITY from now on since version 1.20.4.
By following the documentation that you can find here: https://wiki.vg/Protocol#Spawn_Entity it seems that index 2 is now a VarInt corresponding to https://wiki.vg/Entity_metadata#Player.
Expected behavior
So I wrote the code below:
However, here is the error I have:
It seems that the expected type is not a VarInt but in EntityTypes. I didn't manage to go any further.
If anyone could help me I would be very grateful.
I use the Paper version git-Paper-454 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 99a6416) with the last build of Protocolibs 5.2.0-SNAPSHOT-679.
PS: my old function :
Version Info
https://pastebin.com/gWkE15q9
Additional context
Like every time I file a ticket, I want to thank the developers and the community for the work you do <3
The text was updated successfully, but these errors were encountered: