Skip to content

Commit

Permalink
Add mechs item in hand, offhand, for #1450
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 13, 2016
1 parent 26432d7 commit ab2c0c0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -2490,6 +2490,34 @@ public void adjust(Mechanism mechanism) {

Element value = mechanism.getValue();

// <--[mechanism]
// @object dEntity
// @name item_in_hand
// @input dItem
// @description
// Sets item in the entity's hand.
// The entity must be living.
// @tags
// <e@entity.item_in_hand>
// -->
if (mechanism.matches("item_in_hand")) {
getLivingEntity().getEquipment().setItemInMainHand(value.asType(dItem.class).getItemStack());
}

// <--[mechanism]
// @object dEntity
// @name item_in_offhand
// @input dItem
// @description
// Sets item in the entity's offhand.
// The entity must be living.
// @tags
// <e@entity.item_in_offhand>
// -->
if (mechanism.matches("item_in_offhand")) {
getLivingEntity().getEquipment().setItemInOffHand(value.asType(dItem.class).getItemStack());
}

// <--[mechanism]
// @object dEntity
// @name can_pickup_items
Expand Down

0 comments on commit ab2c0c0

Please sign in to comment.