Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-176276

faceLocation and blockFace in 1.6.0-beta for playerPlaceBlock and itemUseOn are backwards

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 1.20.32 Hotfix
    • Unconfirmed
    • Multiple

      Description
      faceLocation in playerPlaceBlock (after doesn't have the property) and itemUseOn for the side that the place on is 0 instead of being negative slightly less than zero quantity so that the user can easily get the placeLocation by Vector.add(block.location, faceLocation).
      face in playerPlaceBlock (after doesn't have the property) and blockFace in itemUseOn for z direction (south and north) placements are backwards.

      Scenarios
      In these examples, the player would be facing exactly in these directions with the other components of their view vector being 0. The facingLocation will be floored and it will be a beforeEvents.ItemUseOn as they seem to be the same.

      West Block Place (x - 1):
        Expected:

          facingLocation: {x: 1, y: 0, z: 0}

          blockFace: "East"

        Observed:

          facingLocation: {x: 1, y: 0, z: 0}

          blockFace: "East"

      East Block Place (x + 1):
        Expected:

          facingLocation: {x: -1, y: 0, z: 0}

          blockFace: "West"

        Observed:

          facingLocation: {x: 0, y: 0, z: 0}

          blockFace: "West"

      South Block Place (z - 1):
        Expected:

          facingLocation: {x: 0, y: 0, z: 1}

          blockFace: "North"

        Observed:

          facingLocation: {x: 0, y: 0, z: 1}

          blockFace: "South"

      North Block Place (z + 1):
        Expected:

          facingLocation: {x: 0, y: 0, z: -1}

          blockFace: "North"

        Observed:

          facingLocation: {x: 0, y: 0, z: 0}

          blockFace: "North"

      Up Block Place (y + 1):
        Expected:

          facingLocation: {x: 0, y: -1, z: 0}

          blockFace: "Down"

        Observed:

          facingLocation: {x: 0, y: 0, z: 0}

          blockFace: "Down"

      Down Block Place (y - 1):
        Expected:

          facingLocation: {x: 0, y: 1, z: 0}

          blockFace: "Up"

        Observed:

          facingLocation: {x: 0, y: 1, z: 0}

          blockFace: "Up"

      Conclusion
      facingLocation doesn't go negative and blockFace in the z direction is backwards.
      facingLocation for the positive placements should be slightly less than 0 quantity so that flooring works correctly and users don't have to do extra conversions to get the block the player placed at. (mostly to check if the player can place it based on position then if not cancel the event).

            mrpatches123 mrpatches123
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: