Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
player.held_item_type
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 24, 2016
1 parent 39e5f1a commit a5c7d7f
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@
import com.denizenscript.denizen2core.utilities.Action;
import com.denizenscript.denizen2core.utilities.Function2;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.type.HandTypes;
import org.spongepowered.api.entity.living.player.Player;

import java.util.HashMap;
Expand Down Expand Up @@ -34,6 +35,16 @@ public Player getInternal() {
public final static HashMap<String, Function2<TagData, AbstractTagObject, AbstractTagObject>> handlers = new HashMap<>();

static {
// <--[tag]
// @Name PlayerTag.held_item_type
// @Updated 2016/11/24
// @Group Identification
// @ReturnType ItemTypeTag
// @Returns the item held by the player.
// @Example "Bob" .held_item_type may return "minecraft:iron_axe".
// @Warning This tag is temporary, until an ItemTag is available!
// -->
handlers.put("held_item_type", (dat, obj) -> new ItemTypeTag(((PlayerTag) obj).internal.getItemInHand(HandTypes.MAIN_HAND).get().getItem()));
// <--[tag]
// @Name PlayerTag.name
// @Updated 2016/08/26
Expand Down

0 comments on commit a5c7d7f

Please sign in to comment.