#deactivate has_gravity

1 messages · Page 1 of 1 (latest)

gritty atlas
#

Hello,
I wanted to deactivate the gravity of an entity with a script. But when I run setProperty("has_gravity", false") on a minecraft entity, it always says "This entity doesn't have the property...". Same thing happens, when I try to set "minecraft:physics" to false.
If anyone has any idea or could help me, I would appreciate it ☺️

gusty gyro
#

setProperty does not refer to components, it refers to minecraft entity's custom properties system.

If you want to change a component you will need to change the small set that the script-api provides or use an entity event with component groups.

gritty atlas
gusty gyro
#

The script api gives you access to some components and their properties for example

entity.getComponent("color").value=5

So some components can be manipulated directly using the script-api, or have their data values can be viewed, however not all of them. Gravity is one that cannot be change or read.

austere inlet
gritty atlas