Bedrock's official addon and script APIs let you add content, but can hardly modify core gameplay. Custom servers like PocketMine and Nukkit offer that control, but sacrifice vanilla features.
Update: Tigramite now has a new CausalEffects class that allows to estimate (conditional) causal effects and mediation based on assuming a causal graph. Have a look at the tutorial. Further, Tigramite ...