We can use an if statement to have code that only runs if a particular condition is true.
- Write an if statement in the tick function, right above the line that moves the chest:
if(this.shouldChestMove){}
- Take the second curly bracket } and move it below the
this.entity
… line. - Put your cursor right before the
this.entity
… line, and press Tab to indent
