HyperScript 1.4.0
Version 1.4.0
Big change
Check your scripts before updating to 1.4.0
<unset value> contains "..."is now always false. It used to compare against the text<none>, socontains "on"was accidentally true for an unset value.{_name.2}used to be a saved global variable with that literal name; it now means element 2 of the local_name.
Added
Resource packs
send resource pack "<url>" [with hash "<sha1>"] to <who>- Events:
on resource pack accept,on resource pack decline,on resource pack successfully loaded,on resource pack failed. - A hash that is not a 40-character SHA-1 hash is reported and the pack is sent without it, since a wrong hash makes clients reject the pack.
Web requests
send get request to "<url>"andsend post request to "<url>" with body "<body>" [headers "<Name: value>", ...].- As a value (
set {_response} to send get request ...) a request must be insideasync:; as a statement it can be used anywhere and is sent in the background. - Requests may only go to public internet addresses. Local and private network addresses are refused unless
web.allow-private-addressesis enabled. New config sectionweb(enabled,allow-private-addresses). urlencoded <text>for putting player input into a URL safely.
Sounds
play sound "<name>" [with pitch <n>] [and volume <n>]followed byat <location>,for <player>,for all playersorfor all players in world "<world>".
Worlds and regions
set time in world "<world>" to <ticks>andset weather in world "<world>" to clear|rain|thunder.- Box regions:
create region "<name>" from <location> to <location>,delete region "<name>", andregion at <location>, which gives the names of the regions containing a location. event's location: the block being broken or clicked.player does not have permission "<node>".
Smaller additions
- A command line may describe its arguments:
command /lookup <player>:. The description becomes the default usage text. {_list.2}/%{_list.2}%reads element 2 of a list held in a local variable.- The demo script gains
/day,/protect,/unprotectand/lookup, a protected-region check and a level-up sound, plus a commented-out resource pack example.
Changed (check existing scripts)
<unset value> contains "..."is now always false. It used to compare against the text<none>, socontains "on"was accidentally true for an unset value.{_name.2}used to be a saved global variable with that literal name; it now means element 2 of the local_name.
Not included
- Regions are HyperScript's own; WorldGuard regions are not read. "Region permissions" are written in scripts (as in the spec's example) rather than configured per region.
- Web answers are plain text; there is no JSON reader yet.