Noob asking for advice!

Oh, sweet, it works! (Sorry, I had to step away for a bit) I don’t really understand why it works now, but I did what you said and it works, and that’s all I care about. XD Thanks a bunch! Now to just figure out how I can set this to trigger once every 24 hours per player. XD

Use the data api to save a date and time on when they last used it. After that check that date and time against the system time and date.

Would that be player-specific? Like, if Player A uses the event on Tuesday at 1:00pm and Player B uses the event on Friday at 3:00pm, will the event trigger for Player A again on Wednesday at 1:00pm and Player B on Saturday at 3:00pm? Or, is it more of a server-wide type of cooldown timer?

For reference, the next addition to the Pixelmon Reforged-compatible version of the TrainerCommands side-mod will have this feature

Awesome. If I switch to Reforged, I’ll certainly keep that in mind.

Which feature are you referring to, by the way? XD

You will be able to run commands when a player right-clicks (possibly also left) a statue, currently all Pixelmon NPCs are supported for interact (right-click)

Ah. I had planned to try doing that with this plugin, as well, instead of using boring old signs like we used to with Skript. Using the Pixelmon statues would make it look prettier and more professional as opposed to the signs, I thought to myself.

Right now just trying to get it working before I try to pretty it up. Its my first attempt at creating a plugin, so the noob is strong with me.

The data api can be either. You know sponges Keys? They are the main part of the data api. The sponge docs explains it better that i ever could.

https://docs.spongepowered.org/stable/en-GB/plugin/data/index.html

(You can change the language if you like)

So, I got the plugin to register clicking on the statues and have that listener execute the command and all that, and it all works fine, except the event fires twice and I don’t understand why. XD

What event are you listening for?

Originally, I had InteractEntityEvent, but now switched it to InteractEntityEvent.Secondary thinking that would solve my problem. (It didn’t).

Please review the javadocs for the event you are using. Your listener is firing once for InteractInventoryEvent.Secondary.MainHand and once for InteractInventoryEvent.Secondary.OffHand. This is the same structure used in other events like InteractBlockEvent, so keep an eye out for that and make sure you’re using the proper events!

Oh, cool. Thanks! It only fires once now. XD