Vote Cooldown
A vote menu with two pieces of state: a global counter that everyone bumps up (server’s all-time vote count) and a per-player temporal variable that locks them out for 24 hours after voting. Pairs incVar (global) with setVarp ::1d (personal temporal) for the typical “vote once a day” pattern.
What it teaches
Section titled “What it teaches”incVarfor global counters that all players sharesetVarpwith the::1dtemporal duration suffix- The
%var_:name:default%placeholder for global vars (note: same colon-default syntax as varp) - Pairing global and personal vars in the same click handler
- Dual-item display for the vote button (ON_COOLDOWN vs READY states)
Global vs personal
Section titled “Global vs personal”Two var families:
var_*/ setVar / incVar - global, server-wide. Everyone reads and writes the same value. Used here for the all-time vote total.varp_*/ setVarp / incVarp - per-player. Each player has their own copy. Used here for the cooldown lockout.
When the click fires, both are touched in the same actions block:
actions { incVar: "ame_vote_total" # global counter +1 setVarp: "ame_vote_cd::1::1d" # per-player 24h temporal lockout ...}The global counter increments forever. The per-player cooldown auto-expires after 1 day, opening the vote button again.
Real vote integration
Section titled “Real vote integration”This example is a self-contained demo. To wire it to actual server voting (Votifier, MinecraftPocket, etc.):
- Don’t have the player click the vote button - the external vote site/proxy fires the reward.
- Use the same
incVar+setVarppattern inside whatever Bukkit listener handles incoming votes. - Set
iconmenu.canclaimperm or similar gate, then this menu becomes a “claim your daily vote reward” button rather than a “vote” button.
The plugin docs page on variables covers persistence options if you need cross-restart guarantees on the global counter.
Try it
Section titled “Try it”- Drop the bundle into
plugins/AbstractMenus/menus/example/. /am reload.- Type
/ame_votein-game. - Click the lime “Vote!” button. Counter goes up, the button turns gray with a 23h 59m countdown.