[SPIGOT-6406] Gravitity-Constant in EntityLiving Created: 03/Apr/21  Updated: 04/Apr/21

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: FreeSoccerHDX Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: entity, spigot
Environment:

No special Environment / All Environment


Attachments: Text File 0101-Added-modifiable-Gravity-to-EntityLiving.patch    
Version: All Versions (1.16+)
Guidelines Read: Yes

 Description   

Add a Gravity-Variable in EntityLiving.class (called 'gravity' for example)

-> public double gravity = 0.08D; // default value of EntityLiving - Gravity

Replace in the Method "public void g(Vec3D vec3d)" of the EntityLiving the

variable "double d0 = 0.08D;" to "double d0 = this.gravity ;"

 

This will allow the possibility to change the gravity of an LivingEntity with a better solution then set Gravity to false and start a 1 tick loop to apply gravity manually.

A nice feature would be to auto save it as nbt so even a restart / chunk unload will not lose that gravity data.

 

Non-EntityLivings like Arrows, Items, Snowballs have custom Gravity values in each of their classes (EntityArrow=0.05000000074505806D, EntityItem=0.04D ....)

 


Generated at Wed Apr 02 10:57:35 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.