#Check Item Math

1 messages · Page 1 of 1 (latest)

gentle root
#

New feature to me that seems to be the answer to what I'm looking for but while trying to get it to check the amount of items in your inventory for a price I'd determine and set per the amount in their inventory.
Shows in-game how it looks: https://prnt.sc/UK6VnO9zCUSW
Currently my config (have not added in shiftclick yet) https://prnt.sc/pxhkf8qaLY26

haughty phoenix
#

Perhaps the normal operation of the placeholder is hindered by a space. Try to remove it.

nameequals:&eEnchanted Potato,

gentle root
#

did that but it won’t take the item now but it will give me the money

toxic juniper
#

Please also send pastes of text, not images

gentle root
#

Sure thing

#

This is the last one I have after messing with it more

toxic juniper
#

right now you have the amount defined as 1

#

so it will check for 1 and remove 1

#

if you remove the amt modifier it will check for any and remove all

#
    shift_right_click_requirement:
      requirements:
        stuff:
          type: 'string equals'
          input: '%checkitem_mat:potato,nameequals:&eEnchanted Potato,enchantments:EFFICIENCY=1%'
          output: 'yes'
          deny_commands:
          - '[message] &c&lCHAOTIC &8» &7You &cdo not &7have any &eEnchanted Potatoes &7to sell.'
    shift_right_click_commands:
    - '[console] eco give %player_name% %math_{checkitem_amount_mat:potato,nameequals:&eEnchanted Potato,enchantments:EFFICIENCY=1}*5%'
    - '[placeholder] %checkitem_remove_mat:potato,amt:1,nameequals:&eEnchanted Potato,enchantments:EFFICIENCY=1%' 
gentle root
#

valid, thanks for catching that. The only issue is the math stuff right now. Can't get it to calculate the enchanted potatoes and not sure if it's just because they aren't default potatoes or what

toxic juniper
#

test with /papi parse

#

test without math first

#

make sure checkitem_amount_... is returning correctly

gentle root
#

I parsed the line: /papi parse flogna %checkitem_amount_mat:potato,nameequals:&eEnchanted Potato,enchantments:EFFICIENCY=1% and it returned with the amount I had in my inventory

#

(sorry for late response, got busy yesterday)

toxic juniper
#

and what does this do?
/papi parse flogna %math_5*{checkitem_amount_mat:potato,nameequals:&eEnchanted Potato,enchantments:EFFICIENCY=1}%

gentle root
#

it gave a price of $20, i'd like to be able to configure that price with it though

toxic juniper
gentle root
#

Is there a way to have it be formatted so instead of 3200000.000 it'd be 32,000,000

toxic juniper
#

you'd have to use an expansion like formatter/numberformatter

gentle root
#

Same with it giving the money. Trying to have it sell the stack for said price but not sure how to make it check for the amount sold to give the price

toxic juniper
#

along with nested, to be able to parse the extra placeholders

gentle root
#

So instead of the *5 at the end it'd be at the front?

toxic juniper
#

that does not matter

gentle root
#

oh ok

toxic juniper
#

25*5 is the same as 5*25

gentle root
#

yeah, just saw you move it from one to the other and wasnt sure if it was needed to be specific

toxic juniper
#

While things happen very quickly, you are technically removing the item before giving the money

#

so you probably have 0 items when it parses

#

Try switching it like I had it or delaying the removal of the item

gentle root
#

Figured once you said the quick thing

#

Lemme see.

toxic juniper
#

I also highly recommend adding the [close] action to your menu to prevent any issues with duping

#

but, you can test that out

gentle root
#

ye was gonna do it but just for my testing it makes it easier to not have it, i appreciate the recommendation though :)

toxic juniper
#

yep yep

gentle root
#

ye that worked, forgot the timing situation from previous menus. appreciate your help again :)

gentle root
#

Ive installed the formatter expansion, just wondering how I'd put it in with my math calcs? I assume %math_4000000*{checkitem_amount_mat:baked_potato,nameequals:&eEnchanted Baked Potato,enchantments:EFFICIENCY=1}% inside of %formatter_number_format_<number>% would be wrong

toxic juniper
#

that's why you gotta use nested 😉

gentle root
#

tyty will read into it. Thank you for all the help and teachings of these new things (to me) :D

gentle root
#

For check items, is it possible to check multiple items in one line? I've been trying to use this &#F55A4F$%math_0:10_35*{checkitem_amount_mat:potato_mat:carrot_mat:wheat}% to check for potato, carrot, and wheat. Since it doesn't work and I can't find anything mentioning it on the PalceHolderAPI site, I figured I'd come over here to see