Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item requirement #71

Closed
galoti opened this issue Nov 2, 2018 · 8 comments
Closed

Item requirement #71

galoti opened this issue Nov 2, 2018 · 8 comments

Comments

@galoti
Copy link

galoti commented Nov 2, 2018

Hello!! In this example is possible change the economy requirement to some item requirement ?

Slot0 {
    Item {
        Count = 1
        ItemType = "minecraft:wheat"
        UnsafeDamage = 0
        DisplayName = "&lWheat seller"
        ItemLore = [
            "&ePrice for %player_name%: $10 => 9 wheats"
            "&eYou can left or right click to buy some wheats"
        ]
    }
    PrimaryAction {
        Command = "cost: 10; console: give %player_name% minecraft:wheat 9"
        KeepInventoryOpen = true
    }
    SecondaryAction {
        Command = "cost: 10; console: give %player_name% minecraft:wheat 9"
        KeepInventoryOpen = true
    }
    Requirements = "%economy_balance% >= 10"
}

I want to change the wheat cost to 2 iron bars and 2 gold bars with specific nbtData (Name and lore). If its possible, could you show an example ?

@ustc-zzzz
Copy link
Member

It is possible. Please refer to the PrimaryAction and SecondaryAction part in the wiki, and pay extra attention to the parts related to HandheldItem.

@galoti
Copy link
Author

galoti commented Nov 6, 2018

Hello!! So, after some reading I was able to make what I wanted. But I still don't know how I deduct 3 of each item. My intention is run the command only if the player have 3 ${aliases.ncxdragon} and 3 ${aliases.ncxflying} on inventory.

   Slot15 = ${aliases.uncxdrafly} {
    PrimaryAction = [{
      Command = "cost-item: 3; console: crates give uncxdrafly %player_name% 1"
	  HandheldItem = ${aliases.ncxdragon}
      KeepInventoryOpen = true
    }, {
	  Command = "cost-item: 3; console: crates give uncxdrafly %player_name% 1"
	  HandheldItem = ${aliases.ncxflying}
      KeepInventoryOpen = true
    }]
    SecondaryAction = [{
      Command = "cost-item: 3; console: crates give uncxdrafly %player_name% 1"
	  HandheldItem = ${aliases.ncxdragon}
      KeepInventoryOpen = true
    }, {
	  Command = "cost-item: 3; console: crates give uncxdrafly %player_name% 1"
	  HandheldItem = ${aliases.ncxflying}
      KeepInventoryOpen = true
    }]
  }

@ustc-zzzz
Copy link
Member

Well, the current design of VirtualChest does not support the simultaneous deduction of two types of items, because a player can only hold an item stack of one type (under the mouse pointer) to submit an action.

@galoti
Copy link
Author

galoti commented Nov 17, 2018

Oh... ok :/

@SirFancyBacon
Copy link

if using SearchInventory = true would that remove the requirement of being handheld?

@galoti
Copy link
Author

galoti commented Nov 20, 2018

Yes, maybe ustc-zzzz forgot about the 'SearchInventory'.

@SirFancyBacon
Copy link

SirFancyBacon commented Nov 24, 2018

Doesn't seem to function unfortunately.. seems even with SearchInventory it can only grab one item at a time.

I would love it if multiple item costs could be added however. it could completely replace the crafting system with something far less restricting if you did.

@ustc-zzzz
Copy link
Member

Close this issue because it seems that @hellbringer616 has submitted a new issue (#74) for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants