Skip to content

Commit

Permalink
add context.is_bed_spawn to player respawn event
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 26, 2019
1 parent 74acc05 commit c2e0297
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizen.events.BukkitScriptEvent;
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.scripts.ScriptEntryData;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.event.EventHandler;
Expand All @@ -24,6 +25,7 @@ public class PlayerRespawnsScriptEvent extends BukkitScriptEvent implements List
//
// @Context
// <context.location> returns a LocationTag of the respawn location.
// <context.is_bed_spawn> returns a boolean indicating whether the player is about to respawn at their bed.
//
// @Determine
// LocationTag to change the respawn location.
Expand Down Expand Up @@ -84,6 +86,9 @@ public ObjectTag getContext(String name) {
if (name.equals("location")) {
return new LocationTag(event.getRespawnLocation());
}
else if (name.equals("is_bed_spawn")) {
return new ElementTag(event.isBedSpawn());
}
return super.getContext(name);
}

Expand Down

0 comments on commit c2e0297

Please sign in to comment.