Change Log:
added EnsureGodmodeWhileProtected config setting to attempt to fix issue with regions plugin
General Info:
Gives players spawnprotection when they respawn or connect to the server.
By default it also gives them vanish for a few seconds after spawning or connecting, the amount of seconds vanish is given for can be set in the config as well as protection seconds.
Protection also cancels if they equip any items (can be disabled in the config).
Protection on join can also be disabled or enabled in the config.
Protection also cancels by default if the player is in a vehicle with any others, also if its enabled in the config protected players vehicles they are in will be auto repaired if the vehicle takes any damage (it will only be auto-repaired if its only that player in the vehicle).
ForceDequipWhileProtected: Forces the player to dequip whatever they equipted while under protection, default config value: false.
If Enabled this will disable protection canceling if they try to equip anything also since it will just make them un-equip anything they try to equip
CancelOnBedSpawn: Cancels the players spawn protection if they spawn at their bed
NOTE: Add the your current set vanish delay in the config file to the MaxProtectionVanishTime (the MaxProtectionVanishTime has to be a whole number, if you add the vanish delay to it and its like 1.2 it will cause a error when the plugin loads, round it up if you need to).
Commands:
- /pstop <player> : Manually stops protection on the specificed player,
Permission: <Permission Cooldown=”0″>stopprot</Permission>
- /pstart <player> : Manually enables protection on a player,
Permission: <Permission Cooldown=”0″>startprot</Permission>
- /toggleprotection : enables / disables the command caller receiving spawn protection when they respawn
Permission: <Permission Cooldown=”0″>toggleprotection</Permission>
IF YOU USE CUSTOM SPAWN POINTS SET SpawnPositionGetDelay TO 200 OR SO MILLISECONDS HIGHER THAN THE TELEPORT DELAY SET IN CUSTOM SPAWN POINTS CONFIG FILE!
If you would like to donate to support me you can do it through paypal Here
Default configuration
<?xml version="1.0" encoding="utf-8"?>
<SpawnProtectionConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GiveVanishWhileProtected>true</GiveVanishWhileProtected>
<CancelProtectionOnEquip>true</CancelProtectionOnEquip>
<CancelProtectionIfInVehicleWithOthers>true</CancelProtectionIfInVehicleWithOthers>
<CancelOnBedRespawn>true</CancelOnBedRespawn>
<GiveProtectionOnJoin>false</GiveProtectionOnJoin>
<GiveProtectionOnRespawn>true</GiveProtectionOnRespawn>
<AutoRepairProtectedPlayersVehicles>true</AutoRepairProtectedPlayersVehicles>
<SendProtectionMessages>true</SendProtectionMessages>
<ForceDequipWhileProtected>false</ForceDequipWhileProtected>
<EnableProtectionBasedOnDist>false</EnableProtectionBasedOnDist>
<DisableProtectionBasedOnDist>false</DisableProtectionBasedOnDist>
<EnsureGodmodeWhileProtected>false</EnsureGodmodeWhileProtected>
<ProtDisableDist>100</ProtDisableDist>
<ProtEnableDist>100</ProtEnableDist>
<SpawnPositionGetDelay>1100</SpawnPositionGetDelay>
<ProtectionTime>30</ProtectionTime>
<MaxProtectionVanishTime>6</MaxProtectionVanishTime>
<ProtectionVanishDelayMilliseconds>1000</ProtectionVanishDelayMilliseconds>
<ProtectionMessageColor>Yellow</ProtectionMessageColor>
<CommandMessageColor>Green</CommandMessageColor>
<WhitelistedItems>
<ID>65534</ID>
</WhitelistedItems>
<NoSpawnProtection>
<steamid>18446744073709551614</steamid>
</NoSpawnProtection>
</SpawnProtectionConfig>
Default english translation
<?xml version="1.0" encoding="utf-8"?>
<Translations xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Translation Id="prot_started" Value="You have spawn protection for {0} seconds!" />
<Translation Id="canceled_item" Value="Your spawn protection expired because you equipted a item!" />
<Translation Id="expired" Value="Your spawn protection expired!" />
<Translation Id="canceled_veh" Value="Your spawn protection expired because you are in a vehicle with others!" />
<Translation Id="admin_prot_enabled" Value="Enabled protection on {0}!" />
<Translation Id="admin_prot_disabled" Value="Disabled protection on {0}!" />
<Translation Id="usage_start" Value="Correct command usage: /pstart <player>" />
<Translation Id="usage_stop" Value="Correct command usage: /pstop <player>" />
<Translation Id="noplayer" Value="Player '{0}' not found!" />
<Translation Id="canceled_punch" Value="Your spawn protection expired because you punched!" />
<Translation Id="canceled_dist" Value="Your protection has expired because of moving away from spawn!" />
<Translation Id="canceled_bedrespawn" Value="You were not giving spawnprotection due to spawning at your bed" />
<Translation Id="protection_excluded" Value="You have disabled spawnprotection for yourself, do /toggleprotection to enable again" />
<Translation Id="toggled_protection_on" Value="You will now receive spawn protection" />
<Translation Id="toggled_protection_off" Value="You will no longer receive spawn protection" />
</Translations>
Commands and permissions
/toggleprotection
Permissions: toggleprotection
toggles if you receive spawnprotection or not
Git changelog
trying a fix for glitched perma godmode with region's godmode flaged regions
added /toggleprotection to disable/enable protecton for yourself
got a working bedspawncheck added
removed post build command
added CancelOnBedRespawn config option
added ForceDequipWhileProtected config option
added config options for disabling/enabling protection based on distance
added SendProtectionMessages config option
added item whitelisting, whitelisted items will not cancel protection when equipted
added to where protection will cancel if you punch
added GiveProtectionOnRespawn config option
added protection vanish delay in config
added config option to have protection cancel if player is in a vehicle with others
changed default protection vanish time
changed assembly name to AdvancedSpawnProtection and added message color option in config
trying a fix for vanish not workings from protection
First commit, also greatly improved code for spawnprotection