For 1.12, use v1.1 of this plugin.
Please note that 2.X versions are IN NO WAY BACKWARDS COMPATIBLE with 1.X versions (but 1.x configs can be updated to 2.x configs without too much work).
This is my first plugin, so I would really appreciate feedback in order to improve.
A Spigot plugin to allow your players to go trick or treating!
Note video is of v1.1
Players can knock on doors, and get CUSTOM treats (or tricks) defined by a series of console commands in the config.yml file.
Once you've enabled the doors, all your players need to do is knock on any part of the doors in a very intuitive way (more specifically, they must PUNCH the CLOSED door THREE TIMES with an EMPTY HAND within 5 seconds, which is plenty of time to punch a block three times).
They will then see a particle effect (if enabled) on the door(s), and after a moment, the door(s) will fling open, with a sound effect (if enabled), to show their "prize".
COMMANDS:
PERMISSIONS:
tot.* — all admin commands
/regdoor <x> <y> <z>
Saves the door at x,y,z in the database, enabling trick or treating at that door.
Only one side of a door is enabled for trick-or-treating, and you must register the door from the side you want to enable. Also note that the two blocks behind each door will be automatically set to air each time the door is used (normally, they're going to be air anyway).
/regdoubdoor <x1> <y1> <z1> <x2> <y2> <z2>
Saves a set of double doors (one at x1,y1,z1, the other at x2,y2,z2 [must be next to each other on the same y-level]) in the database, enabling trick or treating at those doors.
Only one side of a door is enabled for trick-or-treating, and you must register the door from the side you want to enable. Also note that the two blocks behind each door will be automatically set to air each time the door is used (normally, they're going to be air anyway).
Also note that double doors may not overlap - that is to say that both doors in a double door set must not already be in the database.
/listdoors <page_num>
Lists the doors that have been saved to the database, in groups of ten, by their row_id in the database. A page number can optionally be specified to view that section of results (for example, page 2 would be results 11-20) AFTER HAVING RUN THE INITIAL LOOKUP.
/deldoor <id>
Deletes the specified door, using the row_id specified in listdoor results. In the future, I may add in the possibility of deleting a door by coordinates, but I judged it more important to get the plugin published so that people could use it for Halloween.
/deldoorall
Deletes the entire database of saved doors. Obviously, USE WITH CAUTION.
/reloadtotconfig
Reloads config.yml, as you might expect.
/resetinteractions (<player name> | all)
Resets the limit counter for all players or for one specific player.
CONFIG:
In the config file, you can specify your own tricks and treats using normal console commands (without the preceding slash). For example:
rewards:
creeper:
name: Hisssssss...
where: door
commands:
command1: summon minecraft:creeper <<x>> <<y>> <<z>>
weight: 1
will summon a creeper behind the door when the player knocks.
NAME specifies what this result will be called in the chat and in the log file.
WHERE specifies whether to use the coordinates of the door (actually, the block BEHIND the door) or the player
if replacing coordinates in commands (see following).
COMMANDS SECTION specifies the console commands to run if this result is chosen (they are randomly selected). You can enter any console commands you would normally be able to run, and you can run several commands in a row (each command MUST have a different key value [e.g.
command1, command2, etc...]!).
<<x>>, <<y>>, and <<z>> are replaced at execution with the appropriate part of the coordinates specified in WHERE. <<player_name>> is replaced by the name of the trick-or-treater, so "kill <<player_name>>", for example, would kill the trick-or-treater if it's selected.
WEIGHT specifies the reward's weight in the randomized selection process. Its probability of being selected is (weight)/(sum of ALL prize weights).
Saving a door:
Knocking on a door:
Got lit TNT:
