Advanced NPC Click Commands

mcmonkey

Administrator
Staff member
Helper
A drop-in script that lets you add automatic command execution to NPCs when right-clicked! With bonus advanced features!

Hastebin: https://one.denizenscript.com/haste/64128 <-- Most users, just click here and click "Download the script"

GitHub current version: https://github.com/mcmonkeyprojects/DenizenSampleScripts/blob/master/npc_clickcommand.dsc


NOTE TO USERS COMING FROM CITIZENS:
This is a Denizen script! Denizen is a scripting engine that functions as a plugin for Spigot, and deeply integrates into Citizens to add a lot of extra features to your NPCs. Download Denizen here: https://ci.citizensnpcs.co/job/Denizen/ or learn more about Denizen here: https://guide.denizenscript.com/guides/background/what-is-denizen.html

# Installation:
# Just put the script in your scripts folder and reload.
#
# Usage:
# Select an NPC and use command "/npccommand"
# You can do:
# /npccommand - Display help info
# /npccommand off - Disables command running
# /npccommand set [command] - Sets the NPC to run a specific command
# /npccommand add [command] - Adds a command for the NPC to randomly execute
# You can prefix commands with "player:" to execute as the player, otherwise will execute as the server.
# Use prefix "op:" to execute the command as the player (with operator privileges).
# Add multiple commands to execute at the same time via " - "
# For example: /npccommand set player:summon lightning_bolt - say "shocking!" - player:summon bat
#
# You can use tags. For example: /npccommand add effect give <player.name> speed
#
# Players can right-click the NPC at any time to have a command run.

Also, if you have a Bungee network and want an equivalent to "/server" to use,
The "/server" command exists at the proxy level, not the Spigot server level, and so cannot be accessed directly. A Denizen command script to do basically the same thing is fairly easy to make, and so a sample script of that exact idea is available:
Hastebin: https://one.denizenscript.com/haste/67017 <-- Most users, just click here and click "Download the script"
GitHub current version: https://github.com/mcmonkeyprojects/DenizenSampleScripts/blob/master/sendplayer_command.dsc
This adds the command /sendplayer <player> <server>
With that script added, you can do "/npccommand set sendplayer <player.name> myservernamehere"
 
Last edited:

mcmonkey

Administrator
Staff member
Helper
This is now outdated/irrelevantized thanks to base Citizens "/npc command [add/remove]"

EDIT: actually this still has way more features n stuff.
 

polarassassin

New member
Aug 5, 2020
1
0
0
made an account to say im using this script now in 2020, super useful thank you so much for the scripts you have made!♥♥♥♥