#(mrmaxis) Furnace alerts

17 messages · Page 1 of 1 (latest)

dapper condor
#

Hey! I just started learning Denizen and I came up with an idea of how to make the furnace send an announce or narrate to the player when the items are smelted or the fuel depletes, I used some events but I cannot get it to:

  1. narrate to the player when the items are smelted
  2. check the furnace inventory to see if there is nothing left to smelt
  3. same as 2. but checking if there is no fuel left

this is a snippet of my script, i deleted all the rest

        on furnace starts smelting item:
            - define location <context.location>
            - foreach <player.location.find_players_within[2]> as:players:
                - narrate  "Hey <[players]> Your furnace at <[location]> started smelting <context.source_item>"
feral tendonBOT
#

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.

glad ridge
#

!e block cooks|smelts item

gilded agateBOT
# glad ridge !e block cooks|smelts item
Group

Block

Event Lines

<block> cooks|smelts <item> (into <item>)

Triggers

when an item is smelted/cooked by a block.

Context

<context.location> returns the LocationTag of the block smelting/cooking.
<context.source_item> returns the ItemTag that is being smelted/cooked.
<context.result_item> returns the ItemTag that is the result of the smelting/cooking.

Determine

ItemTag to set the item that is the result of the smelting/cooking.

Has Known Location

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

Cancellable

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

glad ridge
#

also you have multiple problems in your current script

#

furnace starts smelting item doesnt have a linked player, that means you cant use <player>

#

even if you could, your foreach is kinda weird. Youre trying to loop through players but dont actually send the message individually

#

if you want to specify targeted player in narrate use target:<playerTag>

#

!c narrate

gilded agateBOT
# glad ridge !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...

glad ridge
#

aand lastly your <[location]> would narrate locationtag, which would look something like l@3232,31389,1323

#

!t locationtag.format

gilded agateBOT
# glad ridge !t locationtag.format

Formats a LocationTag according to a specified format input.
You can request x, y, z, yaw, or pitch as full "f", short "s", or block "b" format.
eg "fx" for "full X coordinate" (like 1.051234), "syaw" for "short yaw" (like 1.03), or "bz" for "block Z coordinate" (like 1).
"world" is also available to get the world name.
If "$" is in the format, only codes prefixed with "$" will be replaced, eg "$bx but not bx" will become "5 but not bx" (allowing the safe use of unpredictable text inside the format block).

Group

identity

Returns

ElementTag

Examples
# This example does a simple format, like "1, 2, 3".
- narrate "You are at <player.location.format[bx, by, bz]>"
# This example adds colors, uses the "$" prefix to be safe from bugs, and formats like "You are at y = 32 in Space".
- narrate "<&[base]>You are at <player.location.format[y = <&[emphasis]>$by <&[base]>in <&[emphasis]>$world]>"
dapper condor
fiery rivetBOT
#
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.)

#

@dapper condor