//This JSON was modified by Rainvay_ZCYF (@ZouChenyunfei), AgentMindStorm (@agentms_), and LateLag (@LateLagMC). Please do not use this document without permission.
{
  "format_version": "1.10.0",
  "particle_effect": {
    "description": {
      "identifier": "minecraft:splash_spell_emitter",
      "basic_render_parameters": {
        "material": "particles_alpha",
        "texture": "textures/particle/particles"
      }
    },
    "components": {
      "minecraft:emitter_rate_instant": {
        "num_particles": 260
      },
      "minecraft:emitter_lifetime_once": {
        "active_time": 1
      },
      "minecraft:emitter_shape_point": {
        "offset": ["Math.Random(-0.3, 0.3)", "Math.Random(0.1, 0.4)", "Math.Random(-0.3, 0.3)"],
        "direction": ["Math.random(-5,5) * variable.particle_random_1", "(Math.random(-0.3, 0.2) * ((0.2 - 0.2 * (variable.particle_random_3 * variable.particle_random_4)) + 0.8) - 0.5 + ((variable.particle_random_1 < 0.3 && variable.particle_random_2 < 0.3 && variable.particle_random_3 * variable.particle_random_4 < 0.3) ? 3 : 0))>0.5?0.5:(Math.random(-0.3, 0.2) * ((0.2 - 0.2 * (variable.particle_random_3 * variable.particle_random_4)) + 0.8) - 0.5 + ((variable.particle_random_1 < 0.3 && variable.particle_random_2 < 0.3 && variable.particle_random_3 * variable.particle_random_4 < 0.3) ? 3 : 0))", "Math.random(-5,5) * variable.particle_random_2"]
      },
      "minecraft:particle_lifetime_expression": {
        "max_lifetime": "Math.random(0, 1.414) * Math.random(0, 1.414) * (variable.particle_random_4 > 0.9?0.3:1)"
      },
      "minecraft:particle_initial_speed": "Math.pow((variable.particle_random_4 + 0.2), 2) * variable.particle_random_4*10",
      "minecraft:particle_motion_dynamic": {
        "linear_acceleration": [0, "variable.particle_random_3 * 2 + 2", 0],
        "linear_drag_coefficient": "2 * (1 - Math.pow(variable.particle_random_4, 6))"
      },
      "minecraft:particle_appearance_billboard": {
        "size": ["variable.particle_random_4 * 0.03 + 0.12", "variable.particle_random_4 * 0.03 + 0.12"],
        "facing_camera_mode": "rotate_xyz",
        "uv": {
          "texture_width": 128,
          "texture_height": 128,
          "flipbook": {
            "base_UV": [56, "(math.round(variable.color.r * 100) == 26 && math.round(variable.color.g * 100) == 4 && math.round(variable.color.b * 100) == 4) || (math.round(variable.color.r * 100) == 97 && math.round(variable.color.g * 100) == 14 && math.round(variable.color.b * 100) == 14) || (math.round(variable.color.r * 100) == 66 && math.round(variable.color.g * 100) == 40 && math.round(variable.color.b * 100) == 42) ? 72 : 64"],
            "size_UV": [8, 8],
            "step_UV": [-8, 0],
            "frames_per_second": 4,
            "max_frame": 8,
            "stretch_to_lifetime": true
          }
        }
      },
      "minecraft:particle_motion_collision": {
        "enabled": 0,
        "collision_drag": 10,
        "coefficient_of_restitution": 10,
        "collision_radius": 0.0,
        "expire_on_contact": false
      },
      "minecraft:particle_appearance_lighting": {},
      "minecraft:particle_appearance_tinting": {
        "color": [

//Notes: RGB colors provided by variable.color are not quite the same as the real RGB values of the new effect colors.
//       Instead, the colors provided by variable.color are 0-3 higher than the actual values.

//Secondary colors (by mixing effects) are outside the scope of this implementation and will fall back to the default colors.

//The value provided after the ? is always the RGB value of the old color divided by 255.

//Luck is included here, even though it does not exist on Bedrock Edition. It may not fully work!

//Line Order (Repeats For Each R/G/B):

//Random Tinting
//Strength
//Fire Resistance
//Harming
//Healing
//Invisibility
//Leaping
//Luck (not tested)
//Slowness
//Speed
//Night Vision
//Poison
//Regeneration
//Slow Falling
//Turtle Master
//Water Breathing
//Weakness
//Wither
//Fallback to Default Color

//RED
          "
            ((variable.particle_random_1>0.5?variable.particle_random_3:variable.particle_random_4)*0.2+0.8) * (
            math.floor(variable.color.r * 255) == 255 && math.floor(variable.color.g * 255) == 199 ? 0.5882 : 
            math.floor(variable.color.r * 255) == 255 && math.floor(variable.color.g * 255) == 153 ? 0.9098 : 
            math.floor(variable.color.r * 255) == 169 ? 0.2667 : 
            math.floor(variable.color.r * 255) == 248 ? 0.9882 : 
            math.floor(variable.color.r * 255) == 246 ? 0.5059 : 
            math.floor(variable.color.r * 255) == 253 ? 0.1372 : 
            math.floor(variable.color.r * 255) == 89 ? 0.2039 : 
            math.floor(variable.color.r * 255) == 139 ? 0.3607 : 
            math.floor(variable.color.r * 255) == 51 ? 0.4941 : 
            math.floor(variable.color.r * 255) == 194 ? 0.1255 : 
            math.floor(variable.color.r * 255) == 135 ? 0.3098 : 
            math.floor(variable.color.r * 255) == 205 ? 0.8196 : 
            math.floor(variable.color.r * 255) == 243 ? 0.9882 : 
            math.floor(variable.color.r * 255) == 141 ? 0.4667 : 
            math.floor(variable.color.r * 255) == 152 ? 0.1843 : 
            math.floor(variable.color.r * 255) == 72 ? 0.2863 : 
            math.floor(variable.color.r * 255) == 115 ? 0.2078 : 
            variable.color.r)
          ",
//GREEN
          "
            ((variable.particle_random_1>0.5?variable.particle_random_3:variable.particle_random_4)*0.2+0.8) * (
            math.floor(variable.color.r * 255) == 255 && math.floor(variable.color.g * 255) == 199 ? 0.1451 : 
            math.floor(variable.color.r * 255) == 255 && math.floor(variable.color.g * 255) == 153 ? 0.6157 : 
            math.floor(variable.color.r * 255) == 169 ? 0.0392 : 
            math.floor(variable.color.r * 255) == 248 ? 0.1451 : 
            math.floor(variable.color.r * 255) == 246 ? 0.5216 : 
            math.floor(variable.color.r * 255) == 253 ? 0.9882 : 
            math.floor(variable.color.r * 255) == 89 ? 0.6118 : 
            math.floor(variable.color.r * 255) == 139 ? 0.4314 : 
            math.floor(variable.color.r * 255) == 51 ? 0.6980 : 
            math.floor(variable.color.r * 255) == 194 ? 0.1255 : 
            math.floor(variable.color.r * 255) == 135 ? 0.5882 : 
            math.floor(variable.color.r * 255) == 205 ? 0.3686 : 
            math.floor(variable.color.r * 255) == 243 ? 0.9569 : 
            math.floor(variable.color.r * 255) == 141 ? 0.3647 : 
            math.floor(variable.color.r * 255) == 152 ? 0.3294 : 
            math.floor(variable.color.r * 255) == 72 ? 0.3059 : 
            math.floor(variable.color.r * 255) == 115 ? 0.1647 : 
            variable.color.g)
          ",
//BLUE
          "
            ((variable.particle_random_1>0.5?variable.particle_random_3:variable.particle_random_4)*0.2+0.8) * (
            math.floor(variable.color.r * 255) == 255 && math.floor(variable.color.g * 255) == 199 ? 0.1412 : 
            math.floor(variable.color.r * 255) == 255 && math.floor(variable.color.g * 255) == 153 ? 0.2314 : 
            math.floor(variable.color.r * 255) == 169 ? 0.0353 : 
            math.floor(variable.color.r * 255) == 248 ? 0.1412 : 
            math.floor(variable.color.r * 255) == 246 ? 0.5843 : 
            math.floor(variable.color.r * 255) == 253 ? 0.3020 : 
            math.floor(variable.color.r * 255) == 89 ? 0.0 : 
            math.floor(variable.color.r * 255) == 139 ? 0.5137 : 
            math.floor(variable.color.r * 255) == 51 ? 0.7922 : 
            math.floor(variable.color.r * 255) == 194 ? 0.6431 : 
            math.floor(variable.color.r * 255) == 135 ? 0.1961 : 
            math.floor(variable.color.r * 255) == 205 ? 0.6824 : 
            math.floor(variable.color.r * 255) == 243 ? 0.8353 : 
            math.floor(variable.color.r * 255) == 141 ? 0.3922 : 
            math.floor(variable.color.r * 255) == 152 ? 0.6118 : 
            math.floor(variable.color.r * 255) == 72 ? 0.2863 : 
            math.floor(variable.color.r * 255) == 115 ? 0.1529 : 
            variable.color.b)
          ",
//ALPHA (unchanged)
          "variable.color.a"
        ]
      }
    }
  }
}