#Entity not summoning on float position but rather defaulting to integer values on spawn

1 messages · Page 1 of 1 (latest)

upbeat frost
#

I am trying to recreate a Falling Block kind of entity which when it hits the ground placed more than a single block. When it hits the ground it floors the position. Now I need to spawn the entity in the middle of 4 Blocks as this is the EntityType with it's dimensions:

public static final EntityType<ChainPillarEntity> CHAIN_PILLAR_ENTITY = Registry.register(Registries.ENTITY_TYPE,
            Identifier.of(TrialChamberBossMod.MOD_ID, "chain_pillar_entity"),
            EntityType.Builder.create(ChainPillarEntity::new, SpawnGroup.MISC)
                    .dimensions(2f, 4f).build());

The issue I am experiencing is when I run the /summon tcb-mod:chain_pillar_entity 108.5 ~ 33.5 It still spawns it at the same position as 108 ~ 33.

#
@Override
    protected void initDataTracker(DataTracker.Builder builder) {

    }

    @Override
    protected void readCustomDataFromNbt(NbtCompound nbt) {

    }

    @Override
    protected void writeCustomDataToNbt(NbtCompound nbt) {

    }

    protected double getGravity() {
        return 0.04;
    }

    @Override
    public void tick() {
        ++timeFalling;
        TrialChamberBossMod.LOGGER.info("Ticking: {}", timeFalling);
        /*this.applyGravity();
        this.move(MovementType.SELF, this.getVelocity());
        this.tickPortalTeleportation();*/
        if(this.isOnGround()) {
            if (this.getWorld() instanceof ServerWorld serverWorld) {
                this.placeChainPillar(serverWorld, this.getPos());
                this.discard();
            }
        }
    }
}
obsidian meteor
#

this is a quirk of /summon - try using 108.0 and 33.0

upbeat frost
#

omfg