#(pattonsteel) Playsound status

19 messages · Page 1 of 1 (latest)

real radish
#

Hello, I'm looking for a way to check the status of an NPC playing a sound. I've rigged up an NPC to play a music disc upon request like so:

chat trigger:
1:
    trigger: /Blocks|Cat|Chirp|Creator|Far|Mall|Mellohi|Otherside|Pigstep|Precipice|Relic|Stal|Strad|Wait|Ward/
    hide trigger message: true
    show as normal chat: false
    script:
    - playsound <npc.location> sound:music_disc_<context.keyword>

Essentially, I'd like to prevent players from playing a new track before the previous one is finished. I thought I was onto something with the tag, <npc[19].silent>, but it seems like the playsound is not attached to the npc.

Any ideas? Worst case I'll just hard code the various times of each music disk

still runeBOT
#

(pattonsteel) Playsound status

still runeBOT
#

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.

tawdry tapir
#

unless you disable the certain type of sound for the player

#

!m stop_sound

sand viperBOT
# tawdry tapir !m stop_sound

Stops all sounds of the specified type for the player.
Valid types are AMBIENT, BLOCKS, HOSTILE, MASTER, MUSIC, NEUTRAL, PLAYERS, RECORDS, VOICE, and WEATHER
Instead of a type, you can specify a full sound key, which usually has the 'minecraft:' prefix.
If no sound type is specified, all types will be stopped.

Object

PlayerTag

Input

ElementTag

real radish
tawdry tapir
real radish
#

Sadge noises

#

I'll put up what I come up with for the next person that runs into this I guess

tawdry tapir
#

!e on player hears sound

sand viperBOT
# tawdry tapir !e on player hears sound
Group

Player

Event Lines

player hears sound

Switches

key:<sound_key> to only process the event if the sound matches the modern Minecraft sound key.

Triggers

when a player receives a sound packet from the server.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.sound_key> returns an ElementTag of the modern Minecraft sound key.
<context.sound_name> returns an ElementTag of the sound's Bukkit name.
<context.category> returns the name of the category the sound is from.
<context.is_custom> returns 'true' if the sound is custom, otherwise false.
<context.source_entity> returns the entity this sound came from (if any).
<context.location> returns the location the sound will play at.
<context.volume> returns the volume level.
<context.pitch> returns the pitch.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

tawdry tapir
#

you could maybe use that for each sound

#

i wonder if you can ge tthe durection somehow

#

<context.source_entity>

#

hmm maybe there could be a tag for this as a feature req

real radish
#

for anyone interested, I just hard coded the lengths of songs, set a flag to expire at the end of each song, and would check to see if something is in progress