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 ☺️
#deactivate has_gravity
1 messages · Page 1 of 1 (latest)
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.
Can you explain, what you mean by "change the small the set that the script-api provides"?
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.
ur only option is to use component groups and trigger entity events
But the enitity would have to have a component group without gravity and an event that triggers it right? So no removing vanilla entitys gravity...