1. Bl4ckSkull666

    Bl4ckSkull666 Naked Wanderer

    Hello guys,

    how i get the right position of entity and cubes? Why i get 2 difference positions?

    And yes i know Cube's has int and Entity float Positions. But When i'm on a cube and mark it. It must 1 max. 2 difference in Y but there are more difference on all .

    By the example following this positions:
    Cube / Player Position:
    - X: 7 / 9 ~ 2
    - Y: 181 / 219 ~ 38
    - Z: 221 / 265 ~ 44

    Second example:
    -X: -93 / -111 ~ 18
    -Y: 176 / 213 ~ 37
    -Z: 336 / 403 ~ 67

    How can i fix this?

    Here the Code who i get the positions.
    Code (Text):

    void OnCubeTakeDamage(CubeDamageEvent e) {
        Vector3Int pos = e.Position;
        Player p = e.Entity.Owner;
        Vector3Int ppos = new Vector3Int(e.Entity.Position);
    }
     
     
  2. Bl4ckSkull666

    Bl4ckSkull666 Naked Wanderer

    Ok i found the result for it.
    Code (Text):
    void OnCubeTakeDamage(CubeDamageEvent e) {
        Vector3Int pos = e.Position;
        Player p = e.Entity.Owner;
        float x = (float)pos.x/1.2f;
        float y = (float)pos.y/1.2f;
        float z = (float)pos.z/1.2f;
        Vector3 cubePos = new Vector(x, y, z);
    }