CitizensDev / Citizens2

Citizens - the premier plugin and API for creating server-side NPCs in Minecraft.
https://citizensnpcs.co
Open Software License 3.0
590 stars 313 forks source link

Citizens API when setting gravity to enabled it is actually disabled #2269

Closed ieaston5 closed 4 years ago

ieaston5 commented 4 years ago

The output of command /version on my server is: (PLEASE FILL IN) [17:09:42] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-800b93f-8160e29 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT) [17:09:42] [Server thread/INFO]: You are 237 version(s) behind The output of command /version citizens on my server is: (PLEASE FILL IN) [17:09:57] [Server thread/INFO]: Citizens version 2.0.27-SNAPSHOT (build 2084) [17:09:57] [Server thread/INFO]: Website: http://www.citizensnpcs.co [17:09:57] [Server thread/INFO]: Author: fullwall

I am making a plugin using the CitizensAPI aand whenever I spawn an npc, the npc by default has no gravity. When I set the Gravity trait to true (using "npc.getTrait(Gravity.class).setEnabled(true);") the gravity is still disabled. However, when I use "npc.getTrait(Gravity.class).setEnabled(false);" it works perfectly fine. Essentially the results are flipped.

mcmonkey4eva commented 4 years ago

It's just an unclear name. You're enabling the gravity trait, ie you're enabling antigravity.

mcmonkey4eva commented 4 years ago

Also potentially relevant is this existing issue: https://github.com/CitizensDev/Citizens2/issues/2264