Skip to content

Commit

Permalink
Add item_in_offhand for the 1.9 update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 2, 2016
1 parent 0d528fc commit fd15ac8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -1714,7 +1714,20 @@ else if (getLivingEntity().getType() == EntityType.PIG) {
// -->
if (attribute.startsWith("item_in_hand") ||
attribute.startsWith("iteminhand")) {
return new dItem(getLivingEntity().getEquipment().getItemInHand())
return new dItem(getLivingEntity().getEquipment().getItemInMainHand())
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <e@entity.item_in_offhand>
// @returns dItem
// @group inventory
// @description
// Returns the item the entity is holding in their off hand, or i@air if none.
// -->
if (attribute.startsWith("item_in_hand") ||
attribute.startsWith("iteminhand")) {
return new dItem(getLivingEntity().getEquipment().getItemInOffHand())
.getAttribute(attribute.fulfill(1));
}

Expand Down

0 comments on commit fd15ac8

Please sign in to comment.