Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.mcmonkey4eva:Sentinel:'
}
dependencies {
implementation("com.github.mcmonkey4eva:Sentinel:")
}
<dependency>
<groupId>com.github.mcmonkey4eva</groupId>
<artifactId>Sentinel</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.mcmonkey4eva" % "Sentinel" % ""
:dependencies [[com.github.mcmonkey4eva/Sentinel ""]]
Version 2.9.2: Compatible with Spigot 1.19+ through 1.21.3 (Primarily targeted at 1.21.3 - see 'Common Issues' section below if on older supported versions). Contains unvalidated backsupport for older Minecraft versions.
Created by mcmonkey4eva on behalf of the Citizens and Denizen teams.
Join us on Discord!: https://discord.gg/Q6pZGSR in the #sentinel
channel.
plugins
folder.plugins/Sentinel/config.yml
with any text editor) to your liking and finally restart the server./npc sel
or /npc create Bob
)/trait Sentinel
/npc equip
/sentinel addtarget MONSTERS
/sentinel help
/sentinel removeignore owner
./npc path
. It will stand and guard that spot, and return there when not in combat. Consider also setting /sentinel spawnpoint
there./sentinel removeignore owner
spawnpoint
value / are respawning just where they died!"
/npc respawn -1
/sentinel drops
and everything!"
workaround drops
in the config (Find your Sentinel/config.yml
file, open it in a text editor, and change that value from false
to true
, then use /sentinel reload
).workaround damage
(for melee damage issues) and/or enforce damage
(for ranged damage issues) options in the config. You might also consider simply not putting combat NPCs in no-PvP regions (enable PvP in the region, or move them to dedicated combat areas).workaround damage
(for melee damage issues) and/or enforce damage
(for ranged damage issues) options in the config.Here are a few examples of how you might setup and configure an NPC
/npc create MyGuard
/trait sentinel
/sentinel guard yournamehere
and fill 'yournamehere' with your in-game username./sentinel addtarget monsters
/npc equip
then give the NPC any armor and items you want, then /npc equip
again to close the editor./sentinel addavoid creepers
/sentinel addignore npcs
/npc create &b-Guard-
/trait sentinel
/npc path
then click the block the guard should stand on, then /npc path
again./sentinel addtarget monsters
/sentinel addtarget event:pvp
/sentinel addtarget event:pvsentinel
/sentinel spawnpoint
/npc equip
then give the NPC any armor and items you want, then /npc equip
again to close the editor./sentinel squad town1_guards
(this will put all guards of the town in the same 'squad', so they will share target info)/sentinel greeting Welcome to town 1!
/sentinel warning You're not welcome here!
/sentinel greetrange 80
/sentinel range 50
/sentinel chaserange 70
/sentinel realistic true
/sentinel removeignore owner
/sentinel addtarget helditem:.*sword
/npc inventory
and add the second weapon to their inventory/sentinel autoswitch true
/npc create &b-Healer-
/trait sentinel
/npc equip
then give the NPC a health potion and any armor, then /npc equip
again./sentinel addtarget allinone:player|healthbelow:90
to target players below 90% health./sentinel addignore allinone:player|healthabove:90
to ignore players who get above 90% health./sentinel fightback false
/sentinel range 10
/sentinel removeignore owner
/sentinel greeting Hello there traveler!
/sentinel warning You look hurt, let me heal you!
/sentinel greetrange 10
/sentinel spawnpoint
/sentinel invincible true
/npc path
. This means they will still within their chaserange of that point or path, and return to it when out of combat./npc inventory
and add the item to the first (top-left) slot./npc targetable
/sentinel addtarget "npc:some long name here"
Sentinel integrates with a few external plugins, including:
group:GROUP_HERE
)towny:TOWN_HERE
, nation:NATION_HERE
, nationenemies:NATION_HERE
, nationallies:NATION_HERE
)factions:FACTION_HERE
, factionsenemy:NAME
, factionsally:NAME
)simpleclan:CLAN_NAME_HERE
)war_team:WAR_TEAM_NAME
)simplepet:PET_NAME_REGEX
... in particular useful for /sentinel addignore simplepet:.*
to ignore all pets)/sentinel wgregion [region name]
to force the NPC to stay inside that region.Sentinel is integrated into by external plugins as well, including:
held_denizen_item:DENIZEN_ITEM_NAME
for targeting based on targets holding a Denizen item.denizen_proc:PROCEDURE_SCRIPT_NAME
to fire a procedure script.
entity
) is the entity that might be a target.context
) is the optional user-input context info.
denizen_proc:PROCEDURE_SCRIPT_NAME:SOME_CONTEXT_HERE
definitions: entity|context
to avoid script-checker errors.true
or false
to indicate whether the entity is a target.!search sentinel
in #bot-spam
on the Denizen support Discord.quest_in:QUEST_ID
to target players with the given quest started.quest_finished:QUEST_ID
to target players who have already finished the given quest.There's a huge list of valid target types that can be used in the target commands (addtarget
, removetarget
, addignore
, removeignore
, addavoid
, removeavoid
).
These are used, for example, like /sentinel addtarget monsters
(to automatically attack the MONSTERS
target type), or /sentinel addavoid helditem:*_sword
(to run away from players holding swords using the helditem:ITEM_MATCHER
target type).
These are all valid targets and ignores:
owner
is the NPC's ownerpassive_mobs
are all mobs that generally don't attack playersmobs
are both passive and monstersmonsters
are all mobs likely to attack playersplayer:NAME(REGEX)
, npc:NAME(REGEX)
, entityname:NAME(REGEX)
player:bob
to target player named 'bob', or npc:.*\sGuard
to target NPCs named "Space Guard" or "Town Guard" or anything else (uses RegEx).group:GROUPNAME
to target a Vault-compatible permission group by name
helditem:ITEM_MATCHER
, offhand:ITEM_MATCHER
, equipped:ITEM_MATCHER
, in_inventory:ITEM_MATCHER
helditem:diamond_sword
targets enemies that are holding a diamond sword.lore:LORE(REGEX)
as a matcher for a line of lore, or name:NAME(REGEX)
as a matcher for the item display name.offhand:name:Stick\d+
would target players holding an item in their offhand named like "Stick123".pvp
/pvnpc
/pve
/pvsentinel
/eve
/npcvnpc
(pvp is Player-vs-Player, eve is Entity-vs-Entity, etc.)pv:ENTITY
/ev:ENTITY
(pv:ENTITY
is used like event:pv:chicken
for players attacking chickens)event:guarded_fight
to attack whatever the guarded player attacks.event:message:SOMETEXT
will match chat messages that contain 'sometext'.status:STATUS_TYPE
. Current status types:
status:angry
for mobs (wolves, endermen, spiders, etc.) that are currently angry. This is handy with a combo like allinone:enderman|status:angry
status:passive
for non-angrysbteam:SCOREBOARD_TEAM_HERE
(for vanilla scoreboard teams) (WARNING: scoreboards in vanilla minecraft can be cheated by changing your username)sbscoreabove:OBJECTIVE:MIN_VALUE, sbscorebelow:OBJECTIVE:MAX_VALUE
(for vanilla scoreboard objective scores)healthabove:PERCENTAGE
and healthbelow:PERCENTAGE
(for targeting based on current health, useful for example for a healer NPC)permission:PERM.KEY
(for permission based targets, requires a permissions plugin of course)squad:SENTINEL_SQUAD_NAME
(to target another Sentinel SQUAD)uuid:UUID
(to target one single specific entity)potion:POTION_EFFECT
(effect name must be on https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html)npc_owned_by:TARGETER
(to target NPCs that are owned by online players that match certain target data, like npc_owned_by:player:Bob
)multi:TARGET_ONE,TARGET_TWO,...
to have multiple targets required together.
multi:PLAYER,PLAYER,CHICKEN
will make the NPC angry at 2 players and a chicken if they are all together.multi:npc:steve,player,healthabove:50
will make the player angry at the NPC named steve, any one player, and any entity with health above 50%, if all 3 are together.multi
targets do not work with ignores
.allinone:REQUIRED_ONE|REQUIRED_TWO|...
to have multiple target inputs that all must match for a single entity.
allinone:player|healthabove:50
will target specifically a player with health above 50%.allinone:chicken|entityname:cluckers|healthbelow:75
will target specifically injured chickens who are named "cluckers".allinone:dolphin|parrot
doesn't work, because no single entity is both a dolphin and a parrot).allinone
targets inside a multi
target, but you cannot have multi
targets inside an allinone
target.allinone
inside another allinone
, and do not put a multi
inside another multi
.allinone
and multi
targets, you need to use the ID number (use /sentinel targets
and related commands to find the ID), like /sentinel removetarget allinone:0
.event
cannot currently be put inside allinone
or multi
./npc inventory
to set fired arrow type!If you're building a separate plugin you would like to integrate into Sentinel, you should:
<repository>
<id>citizens-repo</id>
<url>https://maven.citizensnpcs.co/repo</url>
</repository>
provided
dependency (be sure to change the version to match the current version available) (note that the exclusions
block can help to prevent maven issues): <dependency>
<groupId>org.mcmonkey</groupId>
<artifactId>sentinel</artifactId>
<version>2.9.2-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
depend
or softdepend
(as relevant) on Sentinel
to your plugin.yml
file. See sample of how Sentinel does this to depend on other plugins: Sample Source HereSentinelIntegration
class: JavaDoc Here
onEnable
, Register the class by calling SentinelPlugin.instance.registerIntegration(new YourIntegration());
where YourIntegration
is the integration class you created.SentinelAttackEvent
: JavaDoc Hereif (npc.hasTrait(SentinelTrait.class)) { ...
SentinelTrait sentinel = npc.getOrAddTrait(SentinelTrait.class);
sentinel.addTarget("monsters");
sentinel.addTarget("uuid:" + player.getUniqueId());
sentinel.setHealth(500);
sentinel.damage = 10;
#sentinel
channel.This is an open source project, provided entirely freely, for everyone to use and contribute to.
If you make any changes that could benefit the community as a whole, please contribute upstream.
You can do basically whatever you want, except you may not hold any developer liable for what you do with the software.
Copyright (C) 2016-2019 Alex "mcmonkey" Goodwin, All Rights Reserved.
The MIT License (MIT)
Copyright (c) 2019-2022 Alex "mcmonkey" Goodwin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.