Sorry for odd title, I didnt have enough room to write it out.
Basically what Im wanting to do is create an item or effect that, when you use it, will trigger a Toggle command identical to what happens when you enter the command in the console. For instance, an amulet that toggles the world off when equipped, and on when removed.
This is just a simple idea i had for making my first mod. I don't need it explained how to do it (and I think I should probably figure it out on my own anyway) I just want to know if its even possible to do.