VariableTriggers

VariableTriggers v1.3.2

Change log

Table of contents

  1. 1 Events
  2. 2 Placeholders
  3. 3 Fixes
  4. 4 Script Commands
  5. 5 An Array of Bug Fixes!
    1. 5.1 Fixes
    2. 5.2 Additions
  6. 6 VT 1.3
    1. 6.1 New Script Commands
    2. 6.2 New Placeholders
    3. 6.3 New Test
    4. 6.4 New Event
    5. 6.5 New Features
    6. 6.6 Fixes
    7. 6.7 Tweaks
    8. 6.8 Tickets
    9. 6.9 Small Updates
    10. 6.10 Fixes
    11. 6.11 Fixes
    12. 6.12 Fixes
    13. 6.13 Fixes
    14. 6.14 Script Commands
    15. 6.15 Event Triggers
    16. 6.16 Place Holders Specific to Chat Event
    17. 6.17 Functional Place Holders Specific to Chat Event
    18. 6.18 Fixes
    19. 6.19 Functional Place Holders
    20. 6.20 Fixes
    21. 6.21 Functional Place Holders
    22. 6.22 Script Commands
    23. 6.23 Functional Place Holders
    24. 6.24 Fixes
    25. 6.25 Changes
    26. 6.26 Functional Place Holders
  7. 7 What's been added so far in the up comming release
    1. 7.1 Fixes
    2. 7.2 Script Commands
    3. 7.3 In-Game Commands
    4. 7.4 Fixes
    5. 7.5 Functional Place Holders Spacific to Command Triggers
    6. 7.6 Place Holders Spacific to Command Triggers
    7. 7.7 Functional Place Holders
    8. 7.8 Script Commands
  8. 8 Command Triggers
    1. 8.1 In-Game Commands for Command Triggers
    2. 8.2 Place Holders Specific to Command Triggers
    3. 8.3 In-Game Commans
    4. 8.4 Functional Place Holders
    5. 8.5 Fixes
    6. 8.6 In-Game Commands
    7. 8.7 Script Commands
    8. 8.8 Place Holders
    9. 8.9 Functional Place Holders
    10. 8.10 Fixes
    11. 8.11 Event Triggers
    12. 8.12 Area Triggers
    13. 8.13 Place Holders Specific to Area Triggers
    14. 8.14 Functional Place Holders
    15. 8.15 Script Commands
    16. 8.16 In-Game Commands
    17. 8.17 Fixes
    18. 8.18 Script Commands
    19. 8.19 Events
    20. 8.20 Place Holders Specific to Interact & EntitySpawn Events
    21. 8.21 Place Holders
    22. 8.22 Functional Place Holders
    23. 8.23 Fixes
    24. 8.24 Events Triggers
    25. 8.25 Script Commands
    26. 8.26 Fixes
    27. 8.27 New Feature
    28. 8.28 New Feature
    29. 8.29 Fixes
    30. 8.30 In-Game Commands
    31. 8.31 Script Commands
    32. 8.32 Fuctional Place Holders

v1.3.2

Events

WorldChange
<worldto> <worldfrom>
You will need the event in the world that you are going to
Sneak
<sneaking> - boolean - true if they entered sneak mode, and false if they went out of it
Sprint
<sprinting> - boolean - true if they started sprinting, false if they stopped
Flight
<flying> - boolean - true if they started flying, false if they landed
WeatherChange
<weather> - boolean - true for stormy, false for sunny
Enable
Triggers when the plugin loads. The world must be set to "VTSYSTEM"
Disable
Triggers when the plugin disables. The world must be set to "VTSYSTEM"

Placeholders

<systemtime:default>
Displays the date and time. You can change default to your preferred format.
See this page for help on formatting.
The default is set at EEEEE, MMMMM dd, H:mm

Fixes

Vault
No longer stops the plugin from being enabled if you don't have a chat plugin
Debug
Some more debug messages have been removed
@MODIFYPLAYER
You can use two underscores to indicate a space for display names and other inputs

Script Commands

@!
Displays helpful-ish debug info, including version, vault hooks, scripts, enable status, etc
Must be run by a player. I recommend making a /debug command to run this.

v1.3.1

An Array of Bug Fixes!

Fixes

Vault HookVault should stop throwing errors for servers with no chat plugin.
Console SpamMost spam has been fixed from old debug code
most.
Timer EventsThey work again!
@PRINTThis now accepts variables.

Additions

<uuid:PLAYER>Obtain an offline player UUID
Example: <uuid:WinneonSword>
<food:PLAYER>Obtain a player's food level
<saturation:PLAYER>Obtain a player's saturation level
/vt savevarsSave all variables to file without waiting for the autosave
/vt sv is a shortcut of this
Array Lists!Sort things into a list.
Related Commands:
@ADDLIST @obj.var something
@REMLIST @obj.var something
@DELLIST @obj.var
@PLAYER @obj.var[index]
@PLAYER @obj.var
Examples:
@ADDLIST @player.list Hugh_Jasses
@ADDLIST @player.list WinneonSword
@PLAYER @player.list[1]
You would see WinneonSword because 1 is the second entry in a list.
Now, if you want to remove WinneonSword from the list...
@REMLIST @player.list WinneonSword
@PLAYER @player.list[0]
We can pull Hugh_Jasses with the index of 0 now. Lastly, to see how many things are in a list...
@PLAYER @player.list
If you do not specify an index, it will display how many items are in there. This would return 1.
You can use variable names for the index as well, such as...
@PLAYER @player.list[<var:$counter.variable>]
This only works with <var:> surrounding the variable.
Also check if something is in the list with @IF @player.list ?= WinneonSword

v1.3

VT 1.3

I've worked very hard on this update, please report any bugs or issues via a ticket! Sorry if your suggestion didn't get in! lyokofirelyte

New Script Commands

@FIREWORKThis has been moved to a safe thread for spigot. You can display pretty fireworks!
Usage: @FIREWORK [color] [type] [location]
Example: @FIREWORK red burst <playerloc>
@PARTICLEAny material can be converted into a particle effect.
Usage: @PARTICLE [material] [location]
Example: @PARTICLE cobblestone <playerloc>
@FALLINGBLOCKThis makes a block fall like sand!
Usage: @FALLINGBLOCK [material] [location]
Example: @FALLINGBLOCK cobblestone 40,40,40
@SETBLOCKSAFEThis is simply @SETBLOCK for Spigot users.
Info: Bukkit users can still use @SETBLOCK for slighty faster performance.
@WORLDTPTeleport to a different world at your current coords.
Usage: @WORLDTP [player] [world]
@CLEARCHATWipes the chat window clean for someone.
Usage: @CLEARCHAT [player]
@PRINTPrints something to console (for debugging?)
Usage: @PRINT [words]
@SWITCH and @CASEIt's like @IF, except better.
Usage: @SWITCH [type] [variable] You can use s, i, and b
Example:
@SWITCH s $object.variable
@CASE red
@PLAYER The object is red!
@CASE blue green orange purple
@PLAYER The object is blue, green, orange, or purple!
@ENDSWITCH
All switches must end with an @ENDSWITCH, but there is not an @ENDCASE, as a @CASE marks the end of the previous one.
@MODIFYPLAYERA whole lot of commands that should allow you to drop some more plugins. #vtmasterrace
Usage: @MODIFYPLAYER [player] [modification] [value]
Example: @MODIFYPLAYER <playername> HEALTH 20
List of modifications:
HEALTH number
FOOD number
SATURATION number
EXP and XP number
WALKSPEED number, please note over 1 is insanely fast; use 0.2 for a little bit of boost.
FLYSPEED number, please note over 1 is insanely fast; use 0.2 for a little bit of boost.
DISPLAYNAME string, you can use color codes like &a
LISTNAME string, you can use colors codes like &a
FLYING boolean
GAMEMODE string, use creative, survival, or adventure
MAXHEALTH number
HELDITEM string, use a valid material, like cobblestone
HELDITEM:MATERIAL string, this keeps the item data and just swaps the material type
HELDITEM:ID string, same as above but in ID form
HELDITEM:META number, used to change the type of something such as white wool to pink wool
HELDITEM:AMOUNT number up to 64
HELDITEM:ENCHANT string, use a valid enchant like damage_all. This will always be a level 1 enchant
HELDITEM:DISPLAYNAME string, keeps data but changes the item name. Color codes work.
HELDITEM:LORE:SET string, sets the lore to that exactly.
HELDITEM:LORE:ADD string, must already have lore to add to
HELDITEM:LORE:REMOVE string, kills all lore
HIDDEN boolean, hides (or unhides) the player from the server (invisible and in tab)
BANNED boolean, this requires advanced mode, and won't kick the player from the server
OPERATOR boolean, this required advanced mode and puts a message in console
@FORKDon't tell Lex about this! :)
@SETVELOCITYPush a player in a direction!
Usage: @SETVELOCITY [player] [x] [y] [z] the numbers for x,y,z are how powerful in that direction to push
Example: @SETVELOCITY <playername> 0 2 0 this would give about 20 blocks of push
@OPENINVOpens an inventory from your InventoryTriggers.yml file
Usage: @OPENINV [name]
Example: @OPENINV teleportInventory
@CLOSEINVForce-closes someone's inventory
Usage: @CLOSEINV [player]

New Placeholders

<playeruuid>Returns the unique identifier of the triggering player.
<playerloc:x>Returns the X coord of the triggering player.
<playerloc:y>Returns the Y coord of the triggering player.
<playerloc:z>Returns the Z coord of the triggering player.
<eval:>Completes the math for the argument.
Usage: <eval:[math]>
Example: <eval:$object.variable%*4*100+10*%object.variable2%+10>
Info: Variables must be separated by "%" symbols so that the script can read them properly.
Example: To say "5 times $object.var plus 7" it would be <eval:5*%$object.var%+7">
<holdingitem:[player]:[material]>Returns true or false if [player] is holding [material]
Example: @IF b <holdingitem:<playername>:cobblestone> = true
<clickedslot>The slot number from an Inventory Event
<clickeditem>The material name of the clicked item in an Inventory Event
<clickeditemname>The display name of the clicked item in an Inventory Event
<inventorytitle>The title of the inventory involved in an Inventory Event To test for spaces, use "_"
<clickeditemlore:index>The lore of the clicked item in an Inventory Event
Example: <clickeditemlore:0> would return the first line of lore

New Test

?=Checks if something contains something.
Example: @IF si $object.var ?= red If this object contains the word red...

New Event

Inventory Click EventFires when you click something in a non-standard inventory and there is a script in that world for it
Script Example: (In EventTriggers file)
  Inventory:
    CoolDown: 0
    Script:
    - '@IF s <inventorytitle> ?= TELEPORTS'
    - '    @SWITCH i <clickedslot>'
    - '        @CASE 0'
    - '            @CMDOP spawn'
    - '        @CASE 1'
    - '            @CMDOP warp <playername> pvp'
    - '        @CASE 2'
    - '            @CMDOP warp <playername> minigames'
    - '    @ENDSWITCH'
    - '@ENDIF'
Creating inventories example (In InventoryTriggers.yml)
teleportInventory:
- 'cancelled: true'
- 'title: TELEPORTS'
- 'slots: 9'
- 'item: wool, meta: 5, amount: 1, name: Spawn, lore: Teleport % &a&ospawn, enchant:
  durability, slot: 0'
- 'item: wool, meta: 6, amount: 1, name: PVP, lore: Teleport % &4&opvp, enchant: durability,
  slot: 1'
- 'item: wool, meta: 7, amount: 1, name: Minigames, lore: Teleport % &3&ominigames,
  enchant: durability, slot: 2'
Specifics:
cancelled: true or false - should we stop the person from taking the item when they click it?
title: inventory title - color codes work!
slots: how many slots? It MUST be in multiples of 9!
item: [material], meta: [number], name: [name], lore: [lore, seperated by % for a new line], enchant: [enchant], slot: [slot]
name, enchant, and lore are optional

New Features

@SIGNTEXTIf you put "%c" for the text, it will clear the line.

Fixes

ENTITIESIf you specify an invalid entity, it will spawn a villager and alert you in console.
SETBLOCKAdded @SETBLOCKSAFE for Spigot users.
FIREWORKMoved @FIREWORK to a safe thread.
FILESExample script should stop throwing errors now.
VAULTVault is once again optional.

Tweaks

CONSOLEConsole messages got a re-work and look prettier.
CONSOLEChanged prefix to [VT] from [VariableTriggers]
SHORTCUT/vt rt can be used for /vt reloadtriggers
SHORTCUT/vt st can be used for /vt savetriggers
SHORTCUT/vt rs can be used for /vt reloadscripts

Tickets

TICKETSPlease include stacktraces & screenshots!

I hope you all enjoy this build :)

v1.2.7

Small Updates

  • Update from lyokofirelyte - Please ensure you delete your old VariableTriggers.jar as this one has a different name!
  • Added <helditemname> to obtain the name of the item in your hand
  • Added <helditemdisplayname> to obtain the display name of the item
  • Added <playerdisplayname> to grab the player display name, works similar to <playername>
  • Added <playerlistname> to obtain the tab list name of a player, similar to <playername>
  • Added <playerprefix> which hooks into Vault to obtain a prefix (Such as PEX Prefix)
  • Added <playersuffix> which hooks into Vault to obtain a suffix (Such as PEX Suffix)
  • Added @FIREWORK <color> <type> <location> to play firework effects (Example, @FIREWORK red burst <playerloc>)
  • Fixed health issues related to 1.7 updating
  • Updated to 1.7.2-R0.1
  • Using Maven for compiling & dependencies
  • Credit to codename_B for firework nms values

SPIGOT USERS: 1.3 will be coming soon which includes a wide array of async fixes, so please be patient!

v1.2.6

Fixes

Addresses the rest of the async errors with script @commands such as @DROPITEM, @EXPLOSION and some other areas. Also removed the delay on @CMDOP, @CMDCON and @CMD I imposed in the last update. I am very hopefull that this will resolve just about all the async issues and a few other smaller issues.

v1.2.5

Fixes

This update addresses async errors with @CMD, @CMPCON, @ENTITY and other concurrent issues with Obj.Vars along with some other issues. I am hopeful that this will also solve the async with Spigot for the above listed commands.

I will be waiting for some feed back on this update from Spigot users

v1.2.4

Fixes

Addresses the concurrent modification issue.

This is only a fix for the issues when @TP, @CMDOP, @SIGNTEXT and @GETENTITYCOUNT So for those having this problem while using these in your scripts this should fix the concurrent modification errors with those. I will be continuing to search out and fix the other major issues before I add new features.

v1.2.2

For bukkit 1.4.6

v1.2.2.Tekkit

This is for the Tekkit users that have been requesting an update top work with Tekkit

v1.2.2

Fixes

Added - /vt savetriggers, /vt reloadtriggers and /vt reloadscripts now display a message in the chat window to the user when you use one of these commands.

Script Commands

@SOUNDEXThis will let you play all those extra sounds and change the volume and pitch of the sound.
Usage: @SOUNDEX [sound] [volume] [pitch] [location]
sound is the name of the sound to play. See Sounds for a list
volume is a value between 0.0 and 1.0
pitch is a value between 0.5 and 2.0
location is the location the sound will come from. If you do not put a location then you will be prompted to click on a location and it will be added for you.
@WHILEThis is a contitional loop and give you ability to loop based on testing. This is and advanced feature and is turned off by default.
Usage: @WHILE [i|b|s|si] [VALUE] [=|!=|>|<|>=|<=] [VALUE]
@ENDWHILEThis ends a while loop block
Usage: @ENDWHILE

Event Triggers

ChatThis is triggered when a player types in the chat window. The normal placeholders refer to this player and ther are a few specific to this event. <chatline> <chatwordcount> and <chatword:index>
TimerThe timer will exicute any script attached to it once every minute. It is up to you to set and test your variables to decide how often to allow exicution.
Usage: /vtevent Timer [SCRIPTLINE]
One important thing to remember is that this is not triggered by a player and therefore the normal place holders are not valid. <playername> will be 'null' and <playerloc> will be 0,0,0 <health> will be 0 and so on. You may use Functional Place Holders that let you set a player name and must get it from object variables you have saved. You may not use @PLAYER as it asumes the triggering player but you may use @BROADCAST or @TELL

Place Holders Specific to Chat Event

<chatline>Will be replaced with the text that was typed in the chat window by player.
<chatwordcount>Will be replaced with the number of words typed in chat window

Functional Place Holders Specific to Chat Event

<chatword:index>This will return the word typed in the chat line at the index. Index starts at 1. If an index is out of range a 'null' text is returned.

v1.2.1

Fixes

Fixed a problem with the @IF @OR @AND logic flow. This problem was cause by changes to accomidate a new feature a few updates ago. I didn't realize the changes caused this locic flow break untill now.

Fixed an issue with converting int to str and str to int with $obj.var's

Functional Place Holders

<hasitem:PLAYER:ITEMID>This will search the PLAYER's Inventory for ITEMID and return the total quantity found. If item is not found will return 0
<takeitem:PLAYER:ITEMID:QUANTITY>This will search the PLAYER's Inventory for QUANTITY of ITEMIDs and take them if QUANTITY is avalible, If PLAYER does not have enough, ITEMID's are not removed and false is returnd.
<giveitem:PLAYER:ITEMID:QUANTITY>This will give PLAYER QUANTITY of ITEMID's. This returns the amount accually given. Player nay not have enough room in inventory for full quntity.
If you need to specify an ID such as Blue Wool 35:3 then you will need to do it with a variable like @SETSTR $obj.var 35:3 and then <hasitem:<playername>:$obj.var>

- v1.2.0

Fixes

FixedThe script error spamming when you use @AND and @OR in scripts. Though the script still worked fine it would give you a false error.
Fixed<var:$obj.var> not working with @DELVAR

Functional Place Holders

<getchar:string:index>Returns the character at index in string. Index starts at 1. If index is out of bounds a 'null' text is returned.

v1.1.9

Script Commands

@BREAKLOOPThis will allow you to break from a @LOOP block. You would use it in an @IF test inside of a Loop block.
Usage: @BREAKLOOP
Example:
@IF b $some.var = true
@BREAKLOOP
@ENDIF

Functional Place Holders

<var:$Obj.Var>Gets the value of an Object Variable. This will be usefull for dynamicaly modifying variable names for possible array creation and usefull for more dynamic use of @CALL
Example: $varArray.s<var:$some.arrayIndex>
Assuming $some.arrayIndex = 12 then you would end up with an object variable named $varArray.s12

v1.1.8

Fixes

  • Fixed so $Obj.Vars are parsed for color codes with @PLAYER, @BROADCAST and @TELL

Changes

  • Changed Auto Save now only displays one line in console window stating that all triggers and data are saved.
  • Added Config option: AutoSaveDisplay if set to false, no auto save info will be displayed.

Functional Place Holders

<totalexp:optionalarg>Gets a players Total Experience earned so far. Replace optionalarg with the name of a player. If player is not found a 'null' text is returned. If playername is not provided then the triggering players total exp is returned.

v1.1.7

What's been added so far in the up comming release

Fixes

Fixed <cmdarg:index> always returning null. It now works properly and returns the value.

Script Commands

@GETSTRLENGets the length of a text String and stores it in an $Obj.Var
Usage: @GETSTRLEN [$OBJ.VAR] [STRINGTOTEST]

In-Game Commands

/vtclickremoveAdded an optional argument to /vtcr You can now give a location x,y,z
Usage: /vtcr [OPTIONALLOCATION]
This will allow you to remove a trigger from a script. Example:
@CMDOP vtcr <triggerloc>
/vtwalkremoveAdded an optional argument to /vtwr You can now give a location x,y,z
Usage: /vtwr [OPTIONALLOCATION]
This will allow you to remove a trigger from a script. Example:
@CMDOP vtwr <triggerloc>

v1.1.6

Fixes

Fixed@TP issue of periodically causing an exception and leaving player as op. Also added a new config option: TeleportOp: set to false to only use @TP without op. Default will be true and is the current method.
Fixedissue using @COOLDOWN in a called event script.

Functional Place Holders Spacific to Command Triggers

<cmdarg:index>This will return the argument typed in the command line not including the command itself. Index starts at 1. If an index is out of range a 'null' text is returned.

Place Holders Spacific to Command Triggers

<cmdline>this will be replaced with the entire line of text that is typed after ths command.

Functional Place Holders

<hour:>Returns the hour. this is game time not real time and it is 0 to 23 no am or pm. 15 would be 3pm
<min:>Returns the minute. this is game time not real time and it is 00 to 59
<getblocklos:proc:range>This is a Line Of Sight function It usses the line of sight of the triggering player. proc can be LOC, NAME, TYPE, ID, DATA and range is the max range in blocks to test and returns the first block found. Not only is this useful for dealing with blocks but it is a great way to get the location the player is looking at.
This returns different values depending on the :proc argument
LOC - returns the location as x,y,z
NAME - returns the Name of the block
TYPE - returns id:data as in 36:1
ID - returns the block id
DATA - returns the data byte of the block
Returns null text if no block is reached within the range so besure you test for null before using the return.

Script Commands

@LOOPStart a loop block. All lines after @LOOP up to the matching @ENDLOOP will be exicuted count times. Each @LOOP MUST have a matching @ENDLOOP and you cannot criss cross @IF blocks.
Usage: @LOOP [COUNT]
@ENDLOOPEnd of a loop block.
Usage: @ENDLOOP

@LOOP is turned off by default. Read http://dev.bukkit.org/server-mods/variabletriggers/pages/about-loops/ to learn how to turn on loops


v1.1.5

Fixed PlayerChatEvent to be compatible with 1.3.1-R1.0


v1.1.4

Command Triggers

Create triggers that run script when a player types a /command. You can make some extra things happen when players type commands like /heal or you can create your very own commands like /foobar or /setquest

If you are extending the functionality of an existing /command

OverrideShould be false
PermissionShould match whatever permission is neaded for this /command

If you are overideing an existing /command with your own functionallity

OverrideShould be true
PermissionShould match whatever permission is neaded for this /command

If you are creating a new /command of your own

OverrideShould be true
PermissionCan be whatever you want it to be or empty if you want everyone to have access. Be sure to add your permission.node to your Permissions YML or Group YML

In-Game Commands for Command Triggers

/vtcommandAliase - /vtcmd Creates a new Command Trigger or adds script to an existing Command.
Usage: /vtcommand [COMMAND] [SCRIPTLINE]
/vtcommandoverrideAliase - /vtcmdo Set override to true | false.
Usage: /vtcommandoverride [COMMAND] [TRUE|FALSE]
By default the Override is set to false.
If Override is set to true will override an existing /command or if no command exists will let you create your own /command. If it is false the normal ingame command will function as normal.
/vtcommandpermissionAliase - /vtcmdp Set or Remove Permission needed for this Command Trigger.
Usage: /vtcommandpermission [COMMAND] [PERMISION.NODE|REMOVE]
By default the Permission is not set. Anyone can use this command.
If you provide a permission.node then player will need that permission to use this command trigger. To remove the permission.node type Remove as the argument
/vtcommandremoveAliase - /vtcmdr Removes an existing Command Trigger.
Usage: /vtcommandremove [COMMAND]
/vtcommandviewAliase - /vtcmdv Views the script on an existing Command Trigger.
Usage: /vtcommandview [COMMAND]
/vtcommandeditAliase - /vtcmde Edit a line of script on an Command Trigger.
Usage: /vtcommandedit [COMMAND] [LINENUMBER] [NEW SCRIPTLINE]
/vtrigger cmdlistAliase - /vt cmdlist Display a list of Command Triggers.
Usage: /vtrigger cmdlist [OPTIONALNAME]
If no argument is provided, a list of command triggers is displayed. If the name of a command trigger is provided then details on that command is displayed.

Place Holders Specific to Command Triggers

<cmdname>will be replaced with the name of the command used.
<cmdargcount>Will be replaced with the number of arguments typed after the command.
Arguments are words or characters separated by spaces.
<cmdarg1>Will be replaced with the first argument after the command if any
<cmdarg2>Will be replaced with the second argument after the command if any
<cmdarg3>Will be replaced with the third argument after the command if any
<cmdarg4>Will be replaced with the fourth argument after the command if any

In-Game Commans

/vteventeditAliase - /vtee Edit a line of script on an Event Trigger
Usage: /vteventedit [EVENT] [LINENUMBER] [NEW SCRIPTLINE]
/vtareaeditAliase - /vtae Edit a line of script on an Area Trigger
Usage: /vteventedit [AREA] [ENTER|EXIT] [LINENUMBER] [NEW SCRIPTLINE]
/vtrigger arealistAliase - /vt arealist Display a list of Command Triggers.
Usage: /vtrigger arealist [WORLD] [AREA]
If no arguments are provided, a list of areas in all worlds is displayed. If the World is provided a list of areas in that World is displayed. If World and Area are both provided, details on that area are displayed.

Functional Place Holders

<currentloc:optionalarg>This place holder now takes an optional argument of playername
If nor arument is provided it will return the triggering players current location. If a player name is provided it will return the current location of the player provided if player is found online. If player is not online will return null

v1.1.3

Fixes

Fixed problem with @CMDOP occasionally not properly releasing op status.
Fixed /vt delvar (an internal error has occured) when deleting variables.
Fixed @COOLDOWN to work properly with Area Triggers and Event Triggers

Added line numbers to the display of script lines on a trigger view (this has nothing to do with the YML file)

In-Game Commands

/vtclickeditEdit a line of script on a Click Trigger
Usage: /vtclickedit [LINENUMBER] [NEW SCRIPTLINE]
/vtwalkeditEdit a line of script on a Walk Trigger
Usage: /vtwalkedit [LINENUMBER] [NEW SCRIPTLINE]

Give me a chance and I'll get the others.

Script Commands

@SIGNTEXTChange the text on a sign. You can use &0-&f, &l-&r color codes
Usage: @SIGNTEXT [LOCATION] [LINE] [TEXT]
Location is optional. You will be asked to click the sign if location is not provided.
@ADDSTRAdd text to the end of an $Obj.Var String
Usage: @ADDSTR [$OBJECT.VAR] [TEXT]
TEXT is the string to add to the end of an existing $Obj.Var of type string
@MULINTMultiply $Obj.Var by INT
Usage: @MULINT [$OBJECT.VAR] [INTVALUE]
@DIVINTDivide $Obj.Var by INT
Usage: @DIVINT [$OBJECT.VAR] [INTVALUE]

Place Holders

<gamemode>Is replaced with the gamemode of the triggering player at the time the trigger was activated.

Functional Place Holders

<endswith:arg1:arg2>Replace arg1 with a string, replace arg2 with a string to test
this will be replaced with a true | false depending on if arg2 ends with arg1.
<endswith:Laiden:LexLaiden> or <endswith:Laiden:<playername>> or <endswith:$string.var1:$string.var2>
<direction:returntype>returns the current direction of the triggering player.
ReturnType is the type you want returned. Replace with INT or TEXT
INT will return direction as an integer 0-15. 0 = NORTH, 1 = NORTH_NORTH_EAST, 2 = NORTH_EAST and so on...
TEXT will return a string NORTH, NORTH_NORTH_EAST and so on...
<secondticks:arg1>Returns the seconds since January 1970. Replace arg1 with a number you want added to it. 0 if you only whant the accual seconds
Example: <secondcticks:0> will return the actual seconds.
Example: <secondcticks:60> will return the seconds plus 60 seconds
Example: <secondcticks:-30> will return the actual seconds minus 30 seconds.

v1.1.2

Fixes

  • Fixed <this> trigger to work with @TOGGLEBLOCK, @SETBLOCK and @GETBLOCK. This fix changed the fromat of <this> place holder and will break any persistent variables that use it. It will create new variables. This fix was needed.
  • Fixed bug in @DELVAR
  • Fixed @TELL to properly convert &0-&f color codes in displayed text.

Event Triggers

QuitThis is triggerd when a player quits the server. <triggerloc> is the player's location

Area Triggers

You can set two locations to create an area cube and set triggers on it.

EnterRuns a script when player enters the area trigger
ExitRuns a script when player exits the area trigger

Place Holders Specific to Area Triggers

<areaentered>Is replaced with the name of the area that is just entered
<areaexited>Is replaced with the name of the area that is just exited
These to place holders are very usefull to test what area is being triggerd and also in the cases that you enter or exit an area inside another area.

Functional Place Holders

<getarea:arg>Replace arg with the location to get. Returns the area name or null if not in an area
Example: <getarea:<playerloc>> or <getarea:$obj.var>

Script Commands

@QUIETPrevents all chat from being displayed on selected player for the number of seconds.
Usage: @QUIET [PLAYERNAME] [SECONDS]
This can be handy for when you want to display a message to a player and you don't want all the chating to scroll it off screen.

In-Game Commands

/vt delobjDeletes an Object and all Variables on the object.
Usage: /vt delobj [OBJNAME]
/vt runRuns a script.
Usage: /vt run [FILE:SCRIPT] <PLAYERNAME>
File:Script uses the same format as the @CALL command. <PLAYERNAME> is optional. If no player is given then the script is run as if the player typing the command activated script.
/vt setareaPus you in set mode to select two loctaions for an area cube.
Usage: /vt setarea
/vt defineareaDefines an area with the two locations you selected with /vt setarea.
Usage: /vt definearea [AREANAME]
/vt getareaGets the name of the Area you ar currently in or null if not in an area.
Usage: /vt getarea
/vtareaCreates a trigger or adds script line to an existing one on an area.
Usage: /vtarea [AREANAME] [Enter|Exit] [SCRIPTLINE]
/vtareaviewView the script on an existing area trigger.
Usage: /vtareaview [AREANAME] [Enter|Exit] [PAGE]
/vtarearemoveRemoves an Enter|Extit trigger from an area and removes the area if no other Trigger exists on it.
Usage: /vtarearemove[AREANAME] [Enter|Exit]

v1.1.1

Fixes

  • Fixed @TOGGLEBLOCK and @SETBLOCK now lets you click the location when adding to an event trigger
  • Fixed Events BlockBreak & BlockPlaced to only be called if no other plugin has canceled event.

Script Commands

@GETLIGHTSaves the light level at Location to the $Obj.Var for later use
Usage: @GETLIGHT [OBJ.VAR] [LOCATION]
This gets the light level (0 to 15) at the Location reguardless if it is sun, moon or lamp light. Keep in mind that if the location is a solid block this will return 0
@TELLDisplays text only to the specified Player. You may use the minecraft color codes &1-&f and special codes &l, &m, &0, &k, &m in any text that will be displayed to the players.
Usage: @TELL [PLAYERNAME] [TEXT MESSAGE]
@ENTITYNow also spawns Farmer, Librarian, Priest, Blacksmith, Butcher.
@IFAdded si test. [i|b|s|si] String Case Insensative.
@IF si Hello = HELLO would be true.

Events

InteractThis is triggerd when a player right clicks on an entity. <triggerloc> is the location of the clicked entity. Entity can be a Player, Mob or Animal. NPC plugins such as Citizens return type PLAYER so you can use their name to determine what NPC is being interacted with.
EntitySpawnThis is triggerd when an entity is spawned. <triggerloc> is the spawn location of the entity. Entity can be a Mob or Animal. This event is usually called A LOT(20 times a second in some casses) so keep your scripts small or use IF test and only do something under certain conditions.

Place Holders Specific to Interact & EntitySpawn Events

<entitytype>Will be replaced with a the type of entity, such as PLAYER, ZOMBIE, VILLAGER... To be used with Interact & EntitySpawn Events
<entityname>Will be replaced with a the name of the entity, if type is PLAYER then the Players name. For Interact, if type is VILLAGER then name will be their profession (FARMER, BUTCHER...), otherwise name will be the same as type. To be used with Interact & EntitySpawn Events

Place Holders

<biome>This will be replace with the biome at the trigger location. In the case of events such as Respawn it is the biome at the respawn location.
Biomes are all caps with underscores as in EXTREME_HILLS

Functional Place Holders

<distance:arg1:arg2>Replace arg1 with a location, replace arg2 with a location
this will be replaced with an integer representing the distance in blocks between the two locations.
<distance:22,67,123:44,71,153> or <distance:<triggerloc>:<playerloc>> or <distance:$loc.var1:22,67,$temp.z>
<startswith:arg1:arg2>Replace arg1 with a string, replace arg2 with a string to test
this will be replaced with a true | false depending on if arg2 starts with arg1.
<startswith:Lex:LexLaiden> or <startswith:Lex:<playername>> or <startswith:$string.var1:$string.var2>

v1.1.0

Fixes

  • Fixed problem with @TP @SETBLCOCK @TOGGLEBLOCK not asking you to set location when setting or adding an Event Trigger.
  • Fixed problem with @SETBLOCK not correctly setting new block if only data byte changed.

Events Triggers

RespawnThis is triggerd when a player respawns after dying. <triggerloc> is the respawn location of player.
JoinThis is triggerd when a player joins the server. <triggerloc> is the player's location

Script Commands

@DROPITEMDrop an item anywhere. You also may add enchantments.
Usage: @DROPITEM [ITEMNAME] [QUANTITY] [ENCHANTMENTS] [LOCATION]
ENCHANTMENTS must be NONE or Enchantment:Level,Enchantment:Level...
Example @DROPITEM Iron_Sword 1 Sharpness:2,BaneOfArthropods:1 <triggerloc>
Example @DROPITEM Dirt 1 NONE 231,65,-122
Example of Item Names: Dirt, Raw_Beef, Wood_Stairs, Chest, Redstone_Wire,Chainmail_Chestplate, Diamond_Helmet
Example of Enchanment Names( no UnderScores): AquaAffinity, FeatherFalling, Protection, ProjectileProtection
It's up to you to know which enchantments can go on what items and what the max level is. Any level set higher than the max for an enchantment will be set to its max for you.
@GETBLOCKSave the block at location in an $Object.Var
Usage: @GETBLOCK [OBJ.VAR] [LOCATION]
With this you can save a block before you change it and then you can change it back to what it was before

v1.0.9b

Fixes

  • Fixed <@CALL [FILE:SCRIPT] it now also will accept an $Obj.Var for either argument.
  • Fixed $Obj.Var to be used almost anywhere as in <relativeloc:<playerloc>:$some.x,$some.y,$some.z>
  • Fixed <isblocktype:arg1:arg2:arg3> if you don't want to test arg3 (data byte) then use -1 for arg3 it will only test the block id
  • Fixed a rare issue with Vault hooking Chat. We don't need a Chat hook so removed issue.

New Feature

  • Also hook Permissions(optional) through Vault <haspermission:permnode> should work fine for those who do not use vault or if you use vault but don't want VariableTriggers going through Vault for permissions you can set the OnlyUseBukkitSuperPerms: true in the VT config.yml

v1.0.9

New Feature

  • Hooked Vault for Economy support! This is an optional hook. If you don't use vault then you will not be able to use any of the features that require Econom, but everything else will still function as normal.
  • Event Triggers Triggers that are Event based. So far i have added these:
    • PlayerDeath - This is triggered when a Player dies for whatever reason. The normal placeholders refer to this player.
    • EntityDeath - This is triggered when an Entity(other than a player) is killed by a player. The normal placeholder refer to the killing player. <triggerloc> refers to the location of the entity on death.|
    • BlockBreak - This is triggered when a block is broken. The normal placeholders refer to the player . <triggerloc> refers to the location of the broke block.|
    • BlockPlaced - This is triggered when a block is placed. The normal placeholders refer to the player . <triggerloc> refers to the location of the placed block.|

Place Holders for the two Death events

<whodied>Will be replaced with a the name of the player that died or the type of entity if not a player, such as Zombie, Spider, Pig...
<killedbyplayer>Will be replaced with a boolean true | false. Use this before using <killername>
<killername>Will be replaced with a the name of the player that did the killing or blank if not killed by a player.

Place Holders for the Block events

<blockid>Will be replaced with the block ID. As in Blue Wool 35:11
<blockdata>Will be replaced with the block data. As in Blue Wool 35:11
<blocktype>Will be replaced with the block type. As in Blue Wool 35:11

The Scripts for Events; BlockBreak and BlockPlaced are called reguardless of any other block protection. So the block that has just been placed or broke may be cancelled so you need to test for this in your script if you only want your script to run if the event was not cancelled. Since VariableTriggers Script Iterpreter runs on its own thread it starts running the script faster than the other plugins have a chance to cancel the event so start your script for these two events with a pause and test like so:
For BlockBreak:

- '// Pause half a second'
- '@PAUSE 0.5'
- '// Test to see if block was is still there'
- '@IF <isblocktype:<triggerloc>:<blocktype>> = false'
- '// Break was succesfull so continue with script'

For BlockPlaced:

- '// Pause half a second'
- '@PAUSE 0.5'
- '// Test to see if block was is still there'
- '@IF <isblocktype:<triggerloc>:<blocktype>> = true'
- '// Place was succesfull so continue with script'

Fixes

  • Fixed issue where when you are clicking a block to add to an existing click trigger the trigger was being triggerd and running the script that was already on it. Now it will no longer be triggerd while you add more script lines to it.
  • Fixed @IF - to use $obj.vars, <placeholder> and oneword constants for the first and second arg when testing strings.
  • Fixed @TOGGLEBLOCK and @SETBLOCK argument [BLOCKID] now excepts data byte [BLOCKID:DATA] as in 76:5
  • Fixed a few issues with vtrigger permissions

In-Game Commands

/vteventAliases vte Creates a new Event Trigger or adds to an existing one.
Usage: /vtevent [EVENT] [SCRIPT LINE]
Possible Events so far: PlayerDeath, EntityDeath, BlockBreak, BlockPlaced
/vteventremoveAliases vter Removes an Event Trigger.
Usage: /vteventremove [EVENT]
/vteventviewAliases vtev View an Event Trigger script.
Usage: /vteventview [EVENT]
/vtrigger delvarAliases vt delvar Removes an Object variable.
Usage: /vtrigger delvar [i|s|b] [OBJECT] [VARIABLE]

Script Commands

@BROADCASTBroadcast a message to the whole server. Color codes &a-&f, &1-&9 and Special codes &l &n &o &m &r are welcome.
Usage: @BROADCAST [TEXT]
@DELVARDeletes an $Object.Variable from memory.
Usage: @DELVAR [i|s|b] [$Obj.Var] - i=int s=str b=bool

Fuctional Place Holders

<hasmoney:arg1:arg2>Replace arg1 with the name of the player and arg2 with a the amount of money you want to see if player has. Replaces with true | false - depending on success
Requires Vault with Economy support
<givemoney:arg1:arg2>Replace arg1 with name of player and arg2 with a the amount of money you want to give player. Replaced with true | false - depending on success
Requires Vault with Economy support
<takemoney:arg1:arg2>Replace arg1 with name of player and arg2 with a the amount of money you want to take from player. Replaced with true | false - depending on success. If player does not have enough money this returns false and does not take any.
Requires Vault with Economy support
<isblocktype:arg1:arg2:arg3>Replace arg1 with location to check and arg2 with the block id and arg3 with the data byte. Replaced with true | false - depending on if the block at location matches.
Examples: <isblocktype:33,65,122:2:0> or <isblocktype:$Obj.Var:<blocktype>> as long as $Obj.Var is a location or <isblocktype:<triggerloc>:$Obj.Var> as long as the $Obj.Var is of type str in the format of 76:5

v1.0.8

Fixes

  • Fixed Exception Issue that was caused when a player who triggerd a script logged off while script was running.

Added In-Game Commands

/vtrigger savetriggersAliases vt savetriggers Saves only the trigger data to YML files.
Usage /vtrigger savetriggers
/vtrigger reloadtriggersAliases vt reloadtriggers Reloads only the trigger data from YML files.
Usage /vtrigger reloadtriggers
/vtrigger reloadscriptsAliases vt reloadscripts Reloads only the sepatate file.script.yml files.
Usage /vtrigger reloadscripts
/vtrigger autosaveAliases vt autosave Pause or Resume autosaveing of data to YML files.
Usage /vtrigger autosave

Added Script Commands

@LIGHTNINGCreates lightning strike at location, CauseDamage = true | false
Usage: LIGHTNING [CAUSEDAMAGE] [LOCATION]
@EXPLOSIONCreates an explosion at location. power=0.0 to 4.0 A power of 0.0 will give effect but no damage.
Usage: @EXPLOSION [POWER] [LOCATION]
@CALLRuns another script from within a script.
Usage: @CALL [FILE:SCRIPT]
FILE is the file without the .script.yml extension that the script is in. SCRIPT is the name of the script to run
@SETBLOCKSets the location to the sepcified block ID
Usage: @TOGGLEBLOCK [BLOCKID] [LOCATION]

Added Fuctional Place Holders

<relativeloc:arg1:arg2>Replace arg1 with a location, replace arg2 with a relative location
This will be replaced with a new location relative to arg1 by arg2. As an example:
<relativeloc:122,67,-218:5,-2,15> This would be replaced with 127,65,203
<relativeloc:$obj.var:20,0,3> or <relativeloc:<triggerloc>:5,-2,15>

New Feature: Separate Script Files

You can also save scripts in separate files filename.script.yml that are auto loaded at startup. VariableTriggers will search for files with .script.yml extension and load to memory for fast access from the interpreter. This in conjunction with the new <relativeloc:arg1:arg2> will allow you to write reusable scripts relative to the <triggerloc> or <playerloc>

To exicute these additional scripts you will use the script command:
@CALL [filename:script]
from within your scripts to run other scripts. for the filename argument do not use the extension. filename.script.yml This in conjunction with the new <relativeloc:arg1:arg2> will allow you to write reusable scripts relative to the <triggerloc> or <playerloc>

To exicute these additional scripts you will use the script command:
@CALL [filename:script]
from within your scripts to run other scripts. For the filename argument do not use the extension. filename.script.yml

You may call as many scripts from within a script as needed as long as you dont call a depth greater than 20. In other words Calling a script from a scipt is a depth of 1 and if that script calls a script your at depth 2 and so on...

If you call a script that calls a script that calls a script ( depth 3) and that script ends so your back at depth 2 and call another script your only depth 3 again. Get it?


v1.0.7

  • Added Comments
    • Start your line with//
    • - '// This is a comment line and will be ignored.'
  • Added <issprinting> PlaceHolder. Will replace with boolean true or false depending on if the triggering player is sprinting at the moment the trigger was triggered.
  • Added <health> Placeholder. Will replace with an integer of the triggering players health at the moment the trigger was triggered
  • Added New Feature Functional Place Holders These work just like normal placeholders except some may take an argument and the replacement is done at the time in the script that the Functional Place Holder is interpreted.
    • <haspermission:argument> Replace argument with a permission node as in some.node
    • <haspotioneffect:argument> Replace argument with the name of a Potion Effect
    • <currentloc:> No argument
    • <random0to:argument> Replace argument with an integer number
    • <random1to:argument> Replace argument with an integer number
    • <health:> No argument
    • <issneaking:> No argument
    • <issprinting:> No argument

v1.0.6

  • Fixed @SETSTR bug.
  • Fixed issue of the first time you run VariableTriggers and reload server before first auto save. This was causing the loss of trigger data.
  • Fixed @TOGGLEBLOCK to work with $obj.var for location
    • Usage: @TOGGLEBLOCK [itemID] [location]
  • Added the ability to use decimal with @PAUSE and @COOLDOWN
    • @PAUSE 2.5 - will pause f0r 2 1/2 seconds
    • @PAUSE 0.1 - will pause for 1 tenth of a second
  • Added @GETENTITYCOUNT [OBJECTVARIABLE] [ENTITY] [RADIUS]
    • OBJECTVARIABLE - An $object.variable to save the count in
    • ENTITY - The entity you want to get the count of ZOMBIE, CREEPER, COW, PLAYER and so on...
    • RADIUS - The radius in blocks from the triggering player to check
    • Usage: @GETENTITYCOUNT $<this>.count ZOMBIE 10
    • This checks for ZOMBIE's in a 10 block radius of the triggering player and saves the the number of zombies found on the trigger object in a variable named count.
  • Fixed a few other minor bugs .

v1.0.5

  • Added @CMDCON command to scripting - This is in responce to a request about PEX. This will execute a command as if it were type at the server consol.
  • Added MaxBackups option to config.yml - This sets the maximum

Facts

Uploaded on
Jun 04, 2014
Game version
  • CB 1.7.9-R0.1
Filename
VariableTriggers.jar
Size
224.4 KiB
MD5
5803ad030d69768b29141c3cd09001ee
Type
Release
Status
Semi-normal
Downloads
1,803

Authors