Set variable for all players?

I am making a plugin, and I am trying to set variables for all players. I want to make a plugin where you can trade, and if you’ve been sent a trade then it’ll set your variable “traded” to one or true, but not for anyone else in the server. (I want to prevent people from typing /accepttrade that weren’t sent a trade). Is this possible? If so, how?

To achieve what you are describing the best method would be to store a Map<UUID, Boolean> or a List<UUID> of people who have received trade reqs. A better way might be to have a Map<UUID, UUID> to store who is trading with whom, or a Trade object which holds the two participants.

Note that @Wundero’s solution will not persist between server restarts; for persistent data, create a DataManipulator.

I’ll try that out!