#(PlayAtDark) Run command on consume item.

46 messages · Page 1 of 1 (latest)

plucky shuttle
#

Hello I'm trying to just run a command when my custom item is consumed. Here is my code.

`special_cooke:
type: item
material: cookie
display name: special_cookie
lore:
- Cookie cookie cookie.

WeaponScripts:
type: world
debug: false
events:
on player consumes special_cookie:
- execute as_server "whisper <player.name> hi"`

dusty cloakBOT
#

(PlayAtDark) Run command on consume item.

dusty cloakBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

stark nebula
#

what command are you trying to run

plucky shuttle
#

The execute as server for now.

candid shale
#

can you elaborate?

#

denizen probably supports whatever you are trying to execute

plucky shuttle
#

The issue isn't the command. I can't get it to run.
I'm going to add a particle effect after.

#

It doesn't trigger the command. It doesn't reach that point.

tepid hazel
#

cooke

candid shale
#

nice

#

typo

#

if you /ex reload, it probably spits an error out for that. definitely don't ignore those errors

stark nebula
#

lmao

plucky shuttle
#

You're correct. Thank you.

tepid hazel
#

are you using vs code with the script editor extension?

plucky shuttle
#

Yes

tepid hazel
#

does it show you a prompt about using execute like that

plucky shuttle
#

No errors.

tepid hazel
#

interesting

#

well

#

as alluded to earlier, whisper is probably the same as narrate

#

and best practices involves using the denizen version of whatever feature you're trying to implement

candid shale
#

for particle effects:

#

!c playeffect

split sableBOT
# candid shale !c playeffect
Group

world

Syntax

playeffect [effect:<name>] [at:<location>|...] (data:<#.#>) (special_data:<data>) (visibility:<#.#>) (quantity:<#>) (offset:<#.#>,<#.#>,<#.#>) (targets:<player>|...) (velocity:<vector>)

Short Description

Plays a visible or audible effect at the location.

Description

Allows the playing of particle effects anywhere without the need of the source it comes from originally.
The particles you may use, can come from sources such as a potion effect or a portal/Enderman with their particles respectively.
Some particles have different data which may include different behavior depending on the data. Default data is 0
Specifying a visibility value changes the sight radius of the effect. For example if visibility is 15; Targeted players won't see it unless they are 15 b...

candid shale
#

for printing text:

#

!c narrate

split sableBOT
# candid shale !c narrate
Group

player

Syntax

narrate [<text>] (targets:<player>|...) (format:<script>) (per_player) (from:<uuid>)

Short Description

Shows some text to the player.

Description

Prints some text into the target's chat area. If no target is specified it will default to the attached player or the console.

Accepts the 'format:<script>' argument, which will reformat the text according to the specified format script. See !language Format Script Containers.

Optionally use 'per_player' with a list of player targets, to have the tags in the text input be reparsed for each and every player.
So, for example, "- narrate 'hello <player.name>' targets:<server.online_players...

plucky shuttle
tepid hazel
#

and if you want, like, a special shape of particles or whatever, you can code a loop with math that draws whatever formula etc

plucky shuttle
tepid hazel
#

!guide

split sableBOT
tepid hazel
#

covers a lot of the basics

#

the rest is just math

plush escarpBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@plucky shuttle