VariableTriggers v1.3.1
Details
-
FilenameVariableTriggers.jar
-
Uploaded by
-
UploadedApr 10, 2014
-
Size216.73 KB
-
Downloads3,992
-
MD55b1bdecec5d910b9824a89826694f965
Supported Bukkit Versions
- 1.7.4
Changelog
v1.3.1
An Array of Bug Fixes!
Fixes
Vault Hook | Vault should stop throwing errors for servers with no chat plugin. |
Console Spam | Most spam has been fixed from old debug code |
most. | |
Timer Events | They work again! |
This 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 savevars | Save 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
@FIREWORK | This has been moved to a safe thread for spigot. You can display pretty fireworks! |
Usage: @FIREWORK [color] [type] [location] | |
Example: @FIREWORK red burst <playerloc> | |
@PARTICLE | Any material can be converted into a particle effect. |
Usage: @PARTICLE [material] [location] | |
Example: @PARTICLE cobblestone <playerloc> | |
@FALLINGBLOCK | This makes a block fall like sand! |
Usage: @FALLINGBLOCK [material] [location] | |
Example: @FALLINGBLOCK cobblestone 40,40,40 | |
@SETBLOCKSAFE | This is simply @SETBLOCK for Spigot users. |
Info: Bukkit users can still use @SETBLOCK for slighty faster performance. | |
@WORLDTP | Teleport to a different world at your current coords. |
Usage: @WORLDTP [player] [world] | |
@CLEARCHAT | Wipes the chat window clean for someone. |
Usage: @CLEARCHAT [player] | |
Prints something to console (for debugging?) | |
Usage: @PRINT [words] | |
@SWITCH and @CASE | It'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. | |
@MODIFYPLAYER | A 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 | |
@FORK | Don't tell Lex about this! :) |
@SETVELOCITY | Push 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 | |
@OPENINV | Opens an inventory from your InventoryTriggers.yml file |
Usage: @OPENINV [name] | |
Example: @OPENINV teleportInventory | |
@CLOSEINV | Force-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 Event | Fires 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
@SIGNTEXT | If you put "%c" for the text, it will clear the line. |
Fixes
ENTITIES | If you specify an invalid entity, it will spawn a villager and alert you in console. |
SETBLOCK | Added @SETBLOCKSAFE for Spigot users. |
FIREWORK | Moved @FIREWORK to a safe thread. |
FILES | Example script should stop throwing errors now. |
VAULT | Vault is once again optional. |
Tweaks
CONSOLE | Console messages got a re-work and look prettier. |
CONSOLE | Changed 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
TICKETS | Please 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
@SOUNDEX | This 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. | |
@WHILE | This 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] | |
@ENDWHILE | This ends a while loop block |
Usage: @ENDWHILE |
Event Triggers
Chat | This 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> |
Timer | The 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
Fixed | The 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
@BREAKLOOP | This 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
@GETSTRLEN | Gets the length of a text String and stores it in an $Obj.Var |
Usage: @GETSTRLEN [$OBJ.VAR] [STRINGTOTEST] |
In-Game Commands
/vtclickremove | Added 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> | |
/vtwalkremove | Added 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. |
Fixed | issue 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
@LOOP | Start 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] | |
@ENDLOOP | End 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
Override | Should be false |
Permission | Should match whatever permission is neaded for this /command |
If you are overideing an existing /command with your own functionallity
Override | Should be true |
Permission | Should match whatever permission is neaded for this /command |
If you are creating a new /command of your own
Override | Should be true |
Permission | Can 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
/vtcommand | Aliase - /vtcmd Creates a new Command Trigger or adds script to an existing Command. |
Usage: /vtcommand [COMMAND] [SCRIPTLINE] | |
/vtcommandoverride | Aliase - /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. | |
/vtcommandpermission | Aliase - /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 | |
/vtcommandremove | Aliase - /vtcmdr Removes an existing Command Trigger. |
Usage: /vtcommandremove [COMMAND] | |
/vtcommandview | Aliase - /vtcmdv Views the script on an existing Command Trigger. |
Usage: /vtcommandview [COMMAND] | |
/vtcommandedit | Aliase - /vtcmde Edit a line of script on an Command Trigger. |
Usage: /vtcommandedit [COMMAND] [LINENUMBER] [NEW SCRIPTLINE] | |
/vtrigger cmdlist | Aliase - /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
/vteventedit | Aliase - /vtee Edit a line of script on an Event Trigger |
Usage: /vteventedit [EVENT] [LINENUMBER] [NEW SCRIPTLINE] | |
/vtareaedit | Aliase - /vtae Edit a line of script on an Area Trigger |
Usage: /vteventedit [AREA] [ENTER| EXIT] [LINENUMBER] [NEW SCRIPTLINE] | |
/vtrigger arealist | Aliase - /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
/vtclickedit | Edit a line of script on a Click Trigger |
Usage: /vtclickedit [LINENUMBER] [NEW SCRIPTLINE] | |
/vtwalkedit | Edit 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
@SIGNTEXT | Change 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. | |
@ADDSTR | Add 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 | |
@MULINT | Multiply $Obj.Var by INT |
Usage: @MULINT [$OBJECT.VAR] [INTVALUE] | |
@DIVINT | Divide $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
Quit | This 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.
Enter | Runs a script when player enters the area trigger |
Exit | Runs 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
@QUIET | Prevents 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 delobj | Deletes an Object and all Variables on the object. |
Usage: /vt delobj [OBJNAME] | |
/vt run | Runs 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 setarea | Pus you in set mode to select two loctaions for an area cube. |
Usage: /vt setarea | |
/vt definearea | Defines an area with the two locations you selected with /vt setarea. |
Usage: /vt definearea [AREANAME] | |
/vt getarea | Gets the name of the Area you ar currently in or null if not in an area. |
Usage: /vt getarea | |
/vtarea | Creates a trigger or adds script line to an existing one on an area. |
Usage: /vtarea [AREANAME] [Enter| Exit] [SCRIPTLINE] | |
/vtareaview | View the script on an existing area trigger. |
Usage: /vtareaview [AREANAME] [Enter| Exit] [PAGE] | |
/vtarearemove | Removes 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
@GETLIGHT | Saves 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 | ||
@TELL | Displays 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] | ||
@ENTITY | Now also spawns Farmer, Librarian, Priest, Blacksmith, Butcher. | |
@IF | Added si test. [i|b|s|si] String Case Insensative. | |
@IF si Hello = HELLO would be true. |
Events
Interact | This 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. |
EntitySpawn | This 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
Respawn | This is triggerd when a player respawns after dying. <triggerloc> is the respawn location of player. |
Join | This is triggerd when a player joins the server. <triggerloc> is the player's location |
Script Commands
@DROPITEM | Drop 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. | |
@GETBLOCK | Save 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
/vtevent | Aliases 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 | |
/vteventremove | Aliases vter Removes an Event Trigger. |
Usage: /vteventremove [EVENT] | |
/vteventview | Aliases vtev View an Event Trigger script. |
Usage: /vteventview [EVENT] | |
/vtrigger delvar | Aliases vt delvar Removes an Object variable. |
Usage: /vtrigger delvar [i|s| b] [OBJECT] [VARIABLE] | |
Script Commands
@BROADCAST | Broadcast 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] | |
@DELVAR | Deletes 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 savetriggers | Aliases vt savetriggers Saves only the trigger data to YML files. |
Usage /vtrigger savetriggers | |
/vtrigger reloadtriggers | Aliases vt reloadtriggers Reloads only the trigger data from YML files. |
Usage /vtrigger reloadtriggers | |
/vtrigger reloadscripts | Aliases vt reloadscripts Reloads only the sepatate file.script.yml files. |
Usage /vtrigger reloadscripts | |
/vtrigger autosave | Aliases vt autosave Pause or Resume autosaveing of data to YML files. |
Usage /vtrigger autosave | |
Added Script Commands
@LIGHTNING | Creates lightning strike at location, CauseDamage = true | false |
Usage: LIGHTNING [CAUSEDAMAGE] [LOCATION] | |
@EXPLOSION | Creates 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] | |
@CALL | Runs another script from within a script. |
Usage: @CALL [FILE:SCRIPT] | |
FILE is the file without the | |
@SETBLOCK | Sets 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.'
- Start your line with
- 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 number of backup files per data type stored in the backup folder.
- Fixed @POOF, @SMOKE, @FLAMES, @SOUND to work with location variable set with /vtrigger setloc
v1.0.4
- Added /vtrigger setloc - This will allow the creation of an $Object.Variable that stores the current position and orientation. Can then be used in script as a location as in @TP $loc.warp2 or @ENTITY ZOMBIE 3 $Castle.loc1
- Added /vtwalkview and /vtclickview - This will allow you to view the script on an existing trigger.
- Fixed a couple minor permission issues
v1.0.3
- Fixed some syntax errors
v1.0.2
- New Release