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:
- Take the second curly bracket } and move it below the
- Put your cursor right before the
this.entity… line, and press Tab to indent