ProtocolLib

3M Downloads

Unable to apply potion effect to entities

grahhnt opened this issue ยท 1 comments

commented

Describe the bug
I am unable to apply a potion effect to an entity

To Reproduce
Steps to reproduce the behavior:

  1. Recreate the code below
  2. Run code, receive error

Expected behavior
To be able to apply a potion effect to entities

Screenshots
image
greyed out line, when used, doesn't create error and doesn't apply effect

Version Info
https://pastebin.com/3CpCQMxP (plugin replaced with MyPlugin)
I have tried using a previous version of protocollib and have tried paper & spigot 1.16.5

Additional context

Caused by: com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.server.v1_16_R3.MobEffectList exists in class PacketPlayOutEntityEffect.
        at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:365) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:345) ~[?:?]
commented

I ended up having to use NMS using the example from this plugin