1. Wiki
  2. /Entities
  3. /minecraft:physics

minecraft:physics

Don't want to write this by hand? GodCraft sets minecraft:physics for you with a switch.Get GodCraft

Overview

minecraft:physics is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Turns basic physics on or off for the entity: falling and bumping into things. Set has_gravity to false for floating mobs.

Fields

FieldTypeDefaultDescription
has_gravitybooleantrueIf true, the entity falls when nothing holds it up.
has_collisionbooleantrueIf true, the entity bumps into blocks instead of passing through them.
push_towards_closest_spacebooleanfalseIf true, an entity stuck inside a block gets nudged out into the nearest free space.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:physics": {
    "has_gravity": true,
    "has_collision": true,
    "push_towards_closest_space": false
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more