#Can I also buy items with items?

1 messages · Page 1 of 1 (latest)

prime token
#

make a has item requirement and as success command remove the items and give the bought ones

vivid tundra
#

to remove the item however, you'll have to either use the /minecraft:clear command that is provided by Minecraft, or a command from a plugin like EssentialsX

#

there is no action in DeluxeMenus that removes items

prime token
#

yeah forgot to mention that thanks peepoHeart

haughty apex
#

But when I remove the item with an Essentials command, a message from Essentials is issued

#

How can I then block the output messages

prime token
#

try to remove it from the language config

#

dont remove the whole thing just make the message ' '

haughty apex
#

Yes, but only for deluxe menus, I need the message for other things

#

There must be a takeitem variable.

vivid tundra
#

Just execute the command as console

prime token
#

what happens if you execute the command as console?

vivid tundra
#

Then the message will only show in console

haughty apex
#

Hey doesn't make any sense

prime token
#

it does

vivid tundra
#

At least, I think so

#

Can't remember

prime token
#

if the console executes it then the console gets the output

#

except players get notif when someone removes items from the inv

haughty apex
#

It wouldn't make any difference it has to be a takeitem variable. Just change Essentials Messages for a plugin what was the author of the plugin thinking

#

I have it as a console output and the player is still notified

prime token
#

idk then

haughty apex
#

@placid acorn Can something be forwarded to the coding team to express a wish for something to be included in the plugin?

#

Sorry for tagging

vivid tundra
#

I understand now what message you were talking about. I thought you meant the message saying "Items cleared from user's inventory" but I forgot essentials also sends a message to the user that had their inventory cleared

#

Have you tried the minecraft clear command?

#

That might not send a message to the affected user

prime token
#

That will remove all items tho

vivid tundra
#

I'm pretty sure it has a way to select amount and stuff does it not?

#

and here's an example on a command that clears only special items

#

It also has examples for 1.12.2 and older since that command had a different syntax

haughty apex
#

It's kind of the same, no matter how you do it, if you use an external command, no matter if Minecraft or Essentials, there are messages as output

tardy pecan
#

or messages to the command runner/console?

haughty apex
#

both

tardy pecan
#

i presume you just want to stop the player message?

haughty apex
#

I get a message at /item take command and /clear item ... command

#

Well it would be mutch better if there was an [itemtake] variable XD

tardy pecan
#

weird i didn't know that vanilla clear did it too

#

you can use checkitem

haughty apex
#

wait

tardy pecan
#

?checkitem

vital nacelleBOT
#
FAQ Answer:

Command:

/papi ecloud download checkitem
/papi reload

Manual Download:
Download
Click here for more information on how to use the CheckItem Expansion.

tardy pecan
#

[placeholder] %checkitem_remove_mat:dirt,amt:1%

#

ex

haughty apex
#

Why can't I insert pictures XD

vital nacelleBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

haughty apex
#

noo Barry say nooooo

vivid tundra
#

logAdminCommands

#

set that gamerule to false

tardy pecan
#

but it'll sitll send the player message

#

oh wait

tardy pecan
#

that goes to all OPs

haughty apex
#

Aren't you going to add a [takeitem] variable or something like that?

vivid tundra
#

You can also use CJ's solution

#

his doesn't have any output

haughty apex
#

But I'm an operator so I see the message when a player clicks on it 😄

vivid tundra
#

@tardy pecan did you add any output to the placeholder?

tardy pecan
#

no I don't send a message to the player

#

the placeholder itself returns yes/no but console doesn't log [placeholder] iirc

vivid tundra
#

yeah it doesn't

#

that was the whole point of adding that action

tardy pecan
#

mc clear doesn't seem to send a message to the player that it's run for

vivid tundra
#

yeah. it just logs admin commands. those logs are seen by operators and by the console

#

and you can disable those logs by disable the gamerule

#

or you can go the other way, which is to use the checkitem placeholder with the [placeholder] action.

haughty apex
tardy pecan
#

don't send picture of text

#

send text

vital nacelleBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

haughty apex
#

left_click_commands:
- '[console] serveritem give mythshard 1 %player_name%'
- '[placeholder] %checkitem_remove_mat:echo_shard,amt:1%'
- '[placeholder] %checkitem_remove_mat:emerald,amt:3%'

tardy pecan
#

what about it?

haughty apex
#

This is the action from my item in the menu

tardy pecan
#

oh okay it's a 1.19 item i'm not that crazy (I have no idea what 1.19 even added 😂 )

tardy pecan
#

Is it working? not working?

haughty apex
#

Or as requirements? No, I think it is not considered, only the first command is fulfilled, but the items are not deducted for me

tardy pecan
#

Not sure what you mean by Or as requirements?

Did you download the checkitem expansion?

#

test the placeholder with /papi parse me %checkitem_remove_mat:echo_shard,amt:1%

vivid tundra
#

this also what version of DeluxeMenus you use, matters. Make sure you're at least on the 1.13.6 release or on the latest 1.13.7 development build

haughty apex
#

Sorry it works I had an outdated version of the CheckItem Expansion

#

Oke nice it works ^^ Thank You soooo mutch

#

It's really complicated and unfortunately there is no record in the wiki but it works if you have it ^^

tardy pecan
#

Checkitem?

haughty apex
#

yes

tardy pecan
#

well it's just a placeholder expansion

#

on the placeholderapi placeholders list

haughty apex
#

Yeah but not in the DeluxeMenu Wiki xD Is PlaceholderAPI from you?

tardy pecan
#

can't add all papi expansions to the dm wiki lol

#

doesn't make sense

tardy pecan
#

helpchat makes both placeholderapi and deluxemenus

haughty apex
#

Then I have to thank you and praise you for helping to create wonderful things with PlaceholderAPI that also help me every day and with which I was able to add wonderful things to my server. Thank you for doing that ^^

tardy pecan
#

😂 thanks, we try 😄

haughty apex
#

Can you help me further? When I used this for my item - '[placeholder] %checkitem_remove_mat:IRON_INGOT,amt:1%'
- '[placeholder] %checkitem_remove_mat:EMERALD,amt:3%'
- '[console] serveritem give running shoes 1 %player_name%' doesn't work for the second item but it does for the first item in the gui

tardy pecan
#

?codeblocks

vital nacelleBOT
#
FAQ Answer:

Use codeblocks for formatting code or configuration files:
```<language name>
<your code here>
```

For example:
```yaml
test:

  • “hi”
  • “there”
    ```

Produces:

test:
- “hi”
- “there”```
tardy pecan
#

fyi

#

not really sure what you mean though

haughty apex
#

So I would like to perform an action when I click on the item, but the item is given to me without having the required items in my inventory.

prime token
#

Share the script please

haughty apex
#

This is my Gui yml:

#

'laufschuhe':
material: IRON_BOOTS
slot: 3
update: true
display_name: '&#f5cba7Laufschuhe'
lore:
- '&7● Gibt dir beim Laufen einen schnelligkeits Boost.'
- '&#a5ff9aHerstellungskosten&f:'
- '&f- &#abebc62x Speedpotion'
- '&f- &#abebc65x Eisen'
- '&f- &#abebc61x Netherite'
left_click_commands:
- '[placeholder] %checkitem_remove_mat:iron_ingot,amt:5%'
- '[placeholder] %checkitem_remove_mat:netherite_ingot,amt:1%'
- '[console] serveritem give laufschuhe 1 %player_name%'
left_click_requirement:
requirements:
has item:
type: 'has item'
material: "DIAMOND"
amount: 1
has item2:
type: 'has item'
material: "netherite_ingot"
amount: 1

#

But do I really need these requirements. Why is it so much more complicated to create a shop where you can pay with items. With Money and others, it's not that much code

prime token
#

okay so first remove the space in the requirement name
then remove the amout 1 or not set is the same
write the netherite_ingot in caps

#

cant find any other problems in the script but maybe its too late for my brain xD

tardy pecan
#

lol items have more data than just 1 value, so it's naturally gonna be longer

#

not that it's much longer though...

        hasitem2:
          type: 'has item'
          material: "netherite_ingot"
          amount: 1
        hasmoney:
          type: 'has money'
          amount: 1

[takemoney] 500
[placeholder] %checkitem_remove_mat:netherite_ingot% or [console] clear %player_name% netherite_ingot 1
🤷‍♂️

#

other than what Orden was saying with the spacing and caps maybe, I also do not see any issues with your configuration

#

You could try using checkitem to check for items as well since you're already using it for removing them though, if has item doesn't work after trying the fixes Orden mentioned

#
type: string equals
input: '%checkitem_mat:netherite_ingot,amt:1%'
output: 'yes'
haughty apex
#

Oke with your improvements it actually works now. I thank them for the help 😄

haughty apex
#

But I have a question. I created a menu where you have to pay for executing a command. Unfortunately, a normal player cannot execute this command. So how can I run the command as a player as an operator?

prime token
#

Instead of [player] put [console] in front of the command

haughty apex
#

I have already tried but I think the command cannot be executed in the console.

#

This is my Command: setblock -1163 69 213 minecraft:chest{LootTable:"chests/buried_treasure"} destroy

prime token
#

It doesnt work because there is not world set

#

If you use it as a player it executes in your current world

#

If you execute it as console it doesnt know where so it doesnt work

haughty apex
#

Do you know how to make it so that it knows what world to run in?

prime token
#

No but google always helps

haughty apex
#

Oke, unfortunately Google tells me that there is no way to use a Minecraft command via console in other worlds. Do you have an idea how I can solve it?

tardy pecan
#

use the placeholder to retrieve the player's world

#

just like their name

haughty apex
#

But I can't include placeholders in a Minecraft Command. or how do you mean that

tardy pecan
#

the command is executed from deluxemenus

tardy pecan
haughty apex
#

The point is that the command (/setblock ...) cannot be executed as a player and neither as a console command.

#

So it's not about the menu above but about another

#

left_click_commands:
- '[placeholder] %checkitem_remove_mat:diamond,amt:2%'
- '[console] setblock %player_world% -1163 69 213 minecraft:chest{LootTable:"chests/buried_treasure"} destroy'
- '[message] &7Deine Lootchest kann nun gelootet werden!'

tardy pecan
#

It can't be run from console?

tardy pecan
haughty apex
#

no minecraft Command cant be run because I'm in a different world than default

tardy pecan
#

ah ya, orden wasn't quite right on this one

#

it only takes coords has no spot for world

haughty apex
#

A player should be able to run this command in the menu, but he can't because it's not a player command and because the console can't use such a command for another world

#

Is there an option with which I can run the command as an op, i.e. the player as an op

tardy pecan
#

Might need a plugin to do this for ya but idk which one

#

hmm

#

what about /execute in minecraft:the_nether run setblock <x> <y> <z> <block> replace

prime token
haughty apex
#

I really only need one option to run the command as an op. Doesn't this function exist. Then you can't implement a lot of things with this plugin. It must be assumed that the player does things in a menu for which he actually has no perm

prime token
#

What about execute as?

tardy pecan
tardy pecan
#

yes

haughty apex
#

im Try

#

yess its crazy its works

prime token
#

Not quiet sure but i think with „/execute as“ you can execute a command with op perms

haughty apex
#

Thank you Thank you

prime token
#

Because if the console makes the player do it there are no perms needed

#

But i have never tested that before so idk