HyperScript 1.5.0
Version 1.5.0
Big change
Check your scripts before updating to 1.5.0
event's locationnow also works inon entity damage,on mob spawnandon player jump(the victim's, the spawn's and the player's position).%{event.entity}%is now set inon entity damageandon mob spawnas well ason entity death.%{event.item}%is now set inon inventory clickas well ason right click.- The words listed under "Event values" are now reserved inside expressions.
itemfollowed by a number is still the list lookupitem 2 of <list>.
Added
Events
on entity damage(also writtenon hit): any entity taking damage. Values:attacker,victim,damage,cause,entity,%{event.location}%. Cancellable.on player jump: works on Spigot and Paper. Cancellable (the player is snapped back, so a small hop may be visible).on mob spawn: valuesentity,reason,%{event.location}%. Cancellable.on inventory click: valuesslot,item,%{event.click_type}%. Cancellable.
Event values
- Short words inside event blocks:
attacker,victim,damage,cause,message,block,entity,killer,reason,slot,item. For exampleif message contains "badword":. - Built-in placeholders can be written without
%{ }%in conditions and expressions:event.cause,player.health,server.tps,arg.1. - New placeholders:
%{event.recipients}%(chat),%{event.drops}%and%{event.location}%(block break),%{player}%,%{player.location}%. isandis notas comparisons:if event.cause is "FALL":,if {player.frozen} is true:.
Documentation site
events_metadata.json: every event with its values, whether it can be cancelled, whoplayeris, and an example. Also served byapp.pyat/events_metadata.jsonand/api/events?name=....- An Events reference page with a section per event and a "try it" box: click a value to add a line that uses it to a small script, then copy the result.
- Every event and every event value is in the search index, so searching
attacker,damageorjumpgoes straight to the event.
Changed (check existing scripts)
event's locationnow also works inon entity damage,on mob spawnandon player jump(the victim's, the spawn's and the player's position).%{event.entity}%is now set inon entity damageandon mob spawnas well ason entity death.%{event.item}%is now set inon inventory clickas well ason right click.- The words listed under "Event values" are now reserved inside expressions.
itemfollowed by a number is still the list lookupitem 2 of <list>.