on rightclick on enchanting table:
cancel event
set the player's level to {player.level}
open chest with 5 rows named "&6&lEnchanting Table" to player
format slot 0 of player with light blue stained glass named "" to be unstealable
format slot 1 of player with light blue stained glass named "" to be unstealable
format slot 2 of player with light blue stained glass named "" to be unstealable
format slot 3 of player with diamond named "&b%player%: %{player.level}% exp" to be unstealable
format slot 4 of player with light blue stained glass named "" to be unstealable
format slot 5 of player with light blue stained glass named "" to be unstealable
format slot 6 of player with light blue stained glass named "" to be unstealable
format slot 7 of player with light blue stained glass named "" to be unstealable
format slot 8 of player with light blue stained glass named "" to be unstealable
cancel event
set the player's level to {player.level}
open chest with 5 rows named "&6&lEnchanting Table" to player
format slot 0 of player with light blue stained glass named "" to be unstealable
format slot 1 of player with light blue stained glass named "" to be unstealable
format slot 2 of player with light blue stained glass named "" to be unstealable
format slot 3 of player with diamond named "&b%player%: %{player.level}% exp" to be unstealable
format slot 4 of player with light blue stained glass named "" to be unstealable
format slot 5 of player with light blue stained glass named "" to be unstealable
format slot 6 of player with light blue stained glass named "" to be unstealable
format slot 7 of player with light blue stained glass named "" to be unstealable
format slot 8 of player with light blue stained glass named "" to be unstealable