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

Particles expiration_expression doesn't work properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.81 Hotfix
    • None
    • Unconfirmed
    • Multiple

      When using the query.camera_distance_range_lerp or any other distance based query as the expiration_expression in the minecraft:particle_lifetime_expression, the particle doesn't spawn at blocks farther away then the given distance from yxz 0, meaning

       

      If a particle is spawned while being in range of xyz 0 + distance then you will see the particle if the distance from you and the particle is also in range of the distance but if you're outside the xyz + distance you won't see the particle and you also won't see the particle if you're farther then the distance away (which is of course expected)

       

      Expected result: particles that are spawned anywhere should only be able to be seen by you if you are in the distance from the particle and if you leave the distance the particle should despawn no matter how far you're away from xyz 0

      Example Code (add a 1x1 white pixel png file in the textures folder called particle.png)
      ```json

      {
          "format_version": "1.10.0",
          "particle_effect": {
              "description": {
                  "identifier": "test:particle",
                  "basic_render_parameters":

      {                 "material": "particles_alpha", "texture": "textures/particle"             }

              },
              "components": {
                  "minecraft:emitter_rate_instant":

      {                 "num_particles": 1}

      ,
                  "minecraft:emitter_lifetime_once":

      {                 "active_time": 1}

      ,
                  "minecraft:particle_lifetime_expression":

      {                 "expiration_expression": "q.camera_distance_range_lerp(10, 10)"}

      ,
                  "minecraft:particle_appearance_billboard":

      {                 "size": [1, 1],"facing_camera_mode": "rotate_xyz"}

      ,
                  "minecraft:particle_appearance_tinting":

      {                 "color": [1, 1, 1, 1 ] }

              }
          }
      }
      ```

       

      Here's a video with an example (ignore that I use a stick to spawn the particles, I've tested it with the /particle command and it still didn't work)

      https://youtu.be/H19f9vnVFYU

            EnisGamingX XxX Enis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: