#(Joshie) Denizen item code but using a mythic crucible furniture?

1435 messages ยท Page 2 of 2 (latest)

frosty hearth
#

Did you check your console?

plain laurel
#
12.03 00:02:11 [Server] INFO ERROR in script 'lantern_of_warding' in queue 'LANTERN_OF_WARDING_741309_0TickAccredited' while executing command 'FLAG' in file 'scripts/warding.dsc' on line '61'!
12.03 00:02:11 [Server] INFO Error Message: Cannot flag 'context.entity.location': that does not appear to be an object! Only objects (like an EntityTag) and special keyword 'server' are flaggable!
12.03 00:02:11 [Server] INFO +- Queue 'LANTERN_OF_WARDING_741309_0TickAccredited' Executing: (line 62) remove <context.entity> ---------+
12.03 00:02:11 [Server] INFO ERROR in script 'lantern_of_warding' in queue 'LANTERN_OF_WARDING_741309_0TickAccredited' while executing command 'REMOVE' in file 'scripts/warding.dsc' on line '62'!
12.03 00:02:11 [Server] INFO Error Message: Invalid context ID 'entity'!
12.03 00:02:11 [Server] INFO Additional Error Info: Tag-base 'context' returned null.
12.03 00:02:11 [Server] INFO Additional Error Info: Tag <context.entity> is invalid!
12.03 00:02:11 [Server] INFO Additional Error Info: Unfilled or unrecognized sub-tag(s) 'context.entity' for tag <context.entity>!
12.03 00:02:11 [Server] INFO Additional Error Info: 'context.entity' is an unknown argument! This was probably caused by a tag not parsing properly.
12.03 00:02:11 [Server] INFO Additional Error Info: Woah! Invalid arguments were specified!
12.03 00:02:11 [Server] INFO Must specify entity/entities!
12.03 00:02:11 [Server] INFO +> [CommandExecutor] Usage: remove [<entity>|...] (world:<world>)
12.03 00:02:11 [Server] INFO +> [CommandExecutor] (Attempted: REMOVE <context.entity>)
12.03 00:02:11 [Server] INFO +---------------------+
12.03 00:02:11 [Server] INFO +- Queue 'LANTERN_OF_WARDING_741309_0TickAccredited' Executing: (line 63) determine NOTHING ---------+
#

Clearly, I need to do that more

#

๐Ÿ˜›

frosty hearth
#

!debug

sturdy acornBOT
# frosty hearth !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

frosty hearth
#

!paste

sturdy acornBOT
frosty hearth
#

If you going to post scripts / debugs, please use the proper tools for it.

plain laurel
#

Here we go

#

Oh wrong thing jesus I need some sleep soon ๐Ÿ˜›

#

But yeah console should help me clear it up

left geyser
#

!e hanging breaks

sturdy acornBOT
# left geyser !e hanging breaks
Group

Entity

Event Lines

<hanging> breaks (because <cause>)

Triggers

when a hanging entity (painting, item_frame, or leash_hitch) is broken.

Context

<context.cause> returns the cause of the entity breaking. Causes: <@link url https://hub.spigotmc....
<context.entity> returns the EntityTag that broke the hanging entity, if any.
<context.hanging> returns the EntityTag of the hanging.

Has Known Location

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

Cancellable

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

left geyser
#

look at the contexts

#

you have it right in the if statement

#

oh wait

#

it is

plain laurel
#
 Filled tag <context.hanging.location.has_flag[lantern_of_warding]> with 'false'.
left geyser
#

wait i'm confused

plain laurel
#

Its just the flag not passing it seems

left geyser
flat comet
left geyser
#

oh my god

plain laurel
#
        on hanging breaks:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - remove <context.hanging.entity>
               - determine passively cancelled
flat comet
#

entity breaks hanging on that one and entity breaks on the other one

plain laurel
#

So this is borked?

left geyser
#

my bad ๐Ÿซค

plain laurel
#

It works without the if statement lol

left geyser
#

yeah no i was wrong

frosty hearth
#

!debug

sturdy acornBOT
# frosty hearth !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

frosty hearth
#

Record a debug of it

plain laurel
#

kk uno momento

left geyser
plain laurel
#

Here is me placing one on a block, breaking the block

#

then gravity doing its thing

#
00:14:19 Filled tag <context.hanging.location.has_flag[lantern_of_warding]> with 'false'. 
00:14:19 No part of the if command passed, no block will run. 
#

Full script

frosty hearth
#

You should read further

left geyser
plain laurel
#

Bruh

#

Yeah thats broken but the if isn't even passing xD

#

but i'll fix that โค๏ธ ty

#
Must specify entity/entities! 
#

thonk

#
<context.hanging.entity>
flat comet
#

<context.hanging> returns an entitytag

#

you don't need the .entity at the end

plain laurel
#

I'm so sure i tried it i'll give it a shot ty

#

Oh my fking god

#

I was editing the flag line

#

Wow the if command works now..

#

So i guess that broken part broke the whole if command?

#

Is that how denizen works?

#
        on hanging breaks:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - remove <context.hanging>
               - determine passively cancelled

Now! The issue is, It kills itself before it pops out the item eeek, And i can't do 'after' because it can't kill itself before the frame breaks (lol)

#

I guess i could just drop the item in that spot?

#

aka spawn it there.

left geyser
#

little nitpick but determine passively cancelled isn't needed in this case. because the determine is at the end of the line, you can just leave it as determine cancelled

plain laurel
#

Now then, I guess I need to find a way to randomly make the item 'appear' at a location

#

aka a 'floating' item waiting to be picked up

flat comet
#

you could use

#

!c spawn

sturdy acornBOT
# flat comet !c spawn
Group

entity

Syntax

spawn [<entity>|...] (<location>) (target:<entity>) (persistent) (reason:<reason>)

Short Description

Spawns a list of entities at a certain location.

Description

Spawn an entity or list of entities at the specified location.

Accepts the 'target:<entity>' argument which will cause all spawned entities to follow and attack the targeted entity.

If the persistent argument is present, the entity will not despawn when no players are within range, causing the entity to remain until killed.

Optionally specify 'reason:<reason>' (Paper only) to specify the reason an entity is spawning for the 'entity spawns' event,
using any reason from <@link url https://hub.s...

flat comet
#

or you could just give the item to the player directly, up to you

plain laurel
#
        on hanging breaks because PHYSICS:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - remove <context.hanging>
               - spawn dropped_item[item=wardinglantern] <context.hanging.location>
               - determine cancelled
#

Something like dis?

little quarry
#

looks right

flat comet
#

nevermind my bad, that spawns an entity not an item, unless there's a workaround that im not seeing lol

plain laurel
#

a dropped item is an entity though right

little quarry
#

lel

plain laurel
#

Yeah nothings dropping, Odd

flat comet
#

i didn't have the location in on my side, ignore that entirely ๐Ÿ˜‚

left geyser
#

don't worry i've made like what? 4 or 5 blunders already in this one thread lol

plain laurel
#

Wait.. if i'm removing the context hanging then trying to get it's location

#

that wont work will it

#

derp

left geyser
#

yeah move the remove to the bottom and it should work

#

should

flat comet
#

key word gecko_smile

left geyser
#

above the determine though

#

then the remove won't fire

plain laurel
#

Nope nothing xD

#
        on hanging breaks because PHYSICS:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - spawn [item=wardinglantern] <context.hanging.location>
               - remove <context.hanging>
               - determine cancelled
#
wardinglantern:
  type: item
  debug: true
  material: PAPER
#

Oh wait a damn min

#

Got it

#

Yep forgot the dropped_item line

left geyser
#

yeah i was about to say haha

plain laurel
#

Now lets see what other functions broke during that eventful 4 hours

#

lmao

#

Oh snap almost forgot

#

need to remove the bounding box and stuff during that special break event

#

Now i'm lost xD

#
        on hanging breaks because PHYSICS:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - spawn dropped_item[item=wardinglantern] <context.hanging.location>
               - define index 1
               - if <cuboid[lantern_of_warding_<player.world.name>].members_size> == 1:
                    - note remove as:lantern_of_warding_<player.world.name>
               - else:
                    - foreach <cuboid[lantern_of_warding_<player.world.name>].list_members> as:entry:
                        - if <[entry]> == <context.entity.location.flag[cuboid]>:
                            - adjust <cuboid[lantern_of_warding_<context.entity.location.world.name>]> remove_member:<[index]>
                            - foreach stop
                        - define index <[index].add[1]>
               - remove <context.hanging>
               - determine cancelled
#

There is a chance I have done some indent issues here and confused the code along with myself

#

Yeah i have i think

#
        on hanging breaks because PHYSICS:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - spawn dropped_item[item=wardinglantern] <context.hanging.location>
               - define index 1
            - if <cuboid[lantern_of_warding_<player.world.name>].members_size> == 1:
              - note remove as:lantern_of_warding_<player.world.name>
            - else:
                - foreach <cuboid[lantern_of_warding_<player.world.name>].list_members> as:entry:
                    - if <[entry]> == <context.entity.location.flag[cuboid]>:
                        - adjust <cuboid[lantern_of_warding_<context.entity.location.world.name>]> remove_member:<[index]>
                        - foreach stop
                    - define index <[index].add[1]>
            - remove <context.hanging>
            - determine cancelled
#

Yeah that's super odd

#

I should use the real paste thingy sorry

little quarry
#

you dont need to use ``define index index.add[1]~`

#

foreach already has that built in

#

!c foreach

sturdy acornBOT
# little quarry !c foreach
Group

queue

Syntax

foreach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]

Short Description

Loops through a ListTag, running a set of commands for each item.

Description

Loops through a ListTag of any type. For each item in the ListTag, the specified commands will be ran for that list entry.

Alternately, specify a map tag to loop over the set of key/value pairs in the map, where the key will be <[key]> and the value will be <[value]>.
Specify "key:<name>" to set the key definition name (if unset, will be "key").

Specify "as:<name>" to set the value definition name (if unset, will be "value").
Use "as:__player" to change the queue's player link, or "as:__npc" t...

left geyser
#

yep already brought this up :/

little quarry
#

<[loop_index]>

little quarry
left geyser
#

its good, a reminder is helpful

plain laurel
#

Yeah i screwed something just gotta figure out what

little quarry
plain laurel
#

gone back to what i thought was my original code and its still not breaking due to gravity lmao

little quarry
#

it pops out, so it runs on everything

plain laurel
#
        on hanging breaks:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - spawn dropped_item[item=wardinglantern] <context.hanging.location>
               - remove <context.hanging>
               - determine cancelled
#

Gotta figure out what iv broke again here

#

Dear lord xD

#

To the debug we go

little quarry
#

yeah post it here

plain laurel
#

Thats placing one letting it float for like 20seconds when it should have broke

#

Hold up a fking min

#

The only difference is i'm now in my base testing not my unclaimed testing area.

#

and i'm in a worldguard region lmao let me try something

#

if this is it i'm going to bed

#

im so angry right now xD

#

I forgot I used worldguard to claim my base as I needed a large area...

#

Odd question but..

in order to handle explosions and stuff

#
on hanging breaks because PHYSICS:
#

Can i change this to because 'anything BUT player'

left geyser
#

also again, if you are doing some cleanup, you can do this

left geyser
# plain laurel Can i change this to because 'anything BUT player'

an idea that I tested out, is to remove because PHYSICS (because that only accounts for physics) and add an if statement that checks if <context.entity> is not null (meaning there is no entity breaking it. for this i used .is_truthy), but also check if the entity is not a player using <context.entity.is_player>.

#

!t objecttag.is_truthy

sturdy acornBOT
# left geyser !t objecttag.is_truthy

Returns true if the object is 'truthy'. An object is 'truthy' if it exists and is valid, and does not represent a concept like emptiness.
An empty list or an air item will return 'false'. Plaintext "null" or "false", an empty element, or a numeric zero will return 'false' as well.
Some object types may have their own logical implementations, for examples an EntityTag value is 'truthy' only if the entity it represents is spawned.
Errored/broken/invalid tags are also considered 'false' by this log...

Returns

ElementTag(Boolean)

left geyser
#

!t entitytag.is_player

sturdy acornBOT
left geyser
#

it should run for anything but a player breaking it the way i did it

left geyser
#

that works too

#

yeah .if_null is more readable in my opinion

plain laurel
#

Man

#

I don't know whats happened but my damn stuff is broke again >.>

#
        on hanging breaks because PHYSICS:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - flag <context.hanging.location> lantern_of_warding:!
               - spawn [item=wardinglantern] <context.hanging.location>
               - remove <context.hanging>
               - determine cancelled
               - flag <context.entity.location> lantern_of_warding:!
               - define index 1
               - if <cuboid[lantern_of_warding_<player.world.name>].members_size> == 1:
                 - note remove as:lantern_of_warding_<player.world.name>
               - else:
                    - foreach <cuboid[lantern_of_warding_<player.world.name>].list_members> as:entry:
                        - if <[entry]> == <context.entity.location.flag[cuboid]>:
                            - adjust <cuboid[lantern_of_warding_<context.entity.location.world.name>]> remove_member:<[index]>
                            - foreach stop
                        - define index <[index].add[1]>
               - remove <context.entity>
               - determine NOTHING

Specifically this

#

Will debug and check console again

storm jewelBOT
plain laurel
#

Been going for an hour or so tryna 'refix'

#

it's only breaking on the hanging event

#

This flag passes '<context.hanging.location.has_flag[lantern_of_warding]>:' in the log

#

Wait it's not qs is it

sturdy acornBOT
plain laurel
#

Okay cleaned that lot up but still being funky

#

Clear log

plain laurel
#

Fixed, used another technique lol!

#

while im here, is there anyway to hide the name that shows when it's inside of the item frame?

half dagger
#

!m display_name

sturdy acornBOT
#
Possible Confusion

Did you mean to search for command displayitem?

half dagger
#

!m ItemTag.display

sturdy acornBOT
# half dagger !m ItemTag.display

Changes the item's display name.
Give no input to remove the item's display name.

Object

ItemTag

Input

ElementTag

Tags

<ItemTag.display> Returns the display name of the item, as set by plugin or an anvil.

plain laurel
#

Oh sweet!

#
  • spawn item_frame[rotation=up;framed=wardinglantern;visible=false] <context.location.add[0,1,0]>
#

I only what it removed when it's in the item frame though hmm

#

I could make a dummy item that has no display name

#

If it i leave display name: blank on the item 'script' it doesn't like it

#

Ah got it display name: <empty>

plain laurel
#

Hey bread ๐Ÿ˜„ im back to here with some math confusion xD

#

So i have

- define cuboid <cuboid[<[loc].world.name>,<[loc].x.add[15]>,<[loc].y>,<[loc].z.add[15]>,<[loc].x.add[-15]>,<[loc].y>,<[loc].z.add[-15]>]>
#

and this is a flat 1 block thick

#

The only ones untouched are both <[loc].y>

#

If i do .add[15= on them it seems to be the same?

#

So that turns into

- define cuboid <cuboid[<[loc].world.name>,<[loc].x.add[15]>,<[loc].y.add[15]>,<[loc].z.add[15]>,<[loc].x.add[-15]>,<[loc].y.add[15]>,<[loc].z.add[-15]>]>
left geyser
#

you want it to go 15 up and 15 down right?

plain laurel
#

Yeah ๐Ÿ™‚

left geyser
#

the second y add is adding positive 15

plain laurel
#

Ohh

#

second one needs - then

left geyser
#

yeah negative y is down

plain laurel
#

Yeah sorry maths isnt my strong suit lol

#

thanks man

#

Also how can i stack the reasons into 1 event here?

#
        on hanging breaks because PHYSICS:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - determine cancelled

        on hanging breaks because ENTITY:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - determine cancelled

        on hanging breaks because EXPLOSION:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - determine cancelled

        on hanging breaks because OBSTRUCTION:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - determine cancelled
#

I assume I don't need 4 events for this lmao

#

I tried a few varients

left geyser
#

you are checking if it breaks for anything but the player, right?

plain laurel
#

Yeah

#

thats the only other 4 reasons

#

xD

plain laurel
#

Yeah I did look at that but got very confused xD

#

i'll revisit it

left geyser
#

if you can't figure it out, let me know and i can walk you through it

#

but try it yourself first ;)

plain laurel
#

Wait a second

#

I got an idea.

#

The only reason I didn't do just

'on hanging breaks'

#

is because of the event

        on item_frame damaged by player:
            - if <context.entity.location.has_flag[lantern_of_warding].if_null[false]>:
                - actionbar "<&c>Warding Beacon Broken - Area unsafe"
                - spawn dropped_item[item=wardinglantern] <context.entity.location>
                - flag <context.entity.location> lantern_of_warding:!
                - define index 1
                - if <cuboid[lantern_of_warding_<player.world.name>].members_size> == 1:
                    - note remove as:lantern_of_warding_<player.world.name>
                - else:
                    - foreach <cuboid[lantern_of_warding_<player.world.name>].list_members> as:entry:
                        - if <[entry]> == <context.entity.location.flag[cuboid]>:
                            - adjust <cuboid[lantern_of_warding_<context.entity.location.world.name>]> remove_member:<[index]>
                            - foreach stop
                        - define index <[index].add[1]>
                - remove <context.entity>
                - determine cancelled
#

But they shouldnt run into each other should they?

#

Yeah i derped there, I think just on hanging breaks is fine lol

#
        on item_frame damaged by player:
            - if <context.entity.location.has_flag[lantern_of_warding].if_null[false]>:
                - actionbar "<&c>Warding Beacon Broken - Area unsafe"
                - spawn dropped_item[item=wardinglantern] <context.entity.location>
                - flag <context.entity.location> lantern_of_warding:!
                - define index 1
                - if <cuboid[lantern_of_warding_<player.world.name>].members_size> == 1:
                    - note remove as:lantern_of_warding_<player.world.name>
                - else:
                    - foreach <cuboid[lantern_of_warding_<player.world.name>].list_members> as:entry:
                        - if <[entry]> == <context.entity.location.flag[cuboid]>:
                            - adjust <cuboid[lantern_of_warding_<context.entity.location.world.name>]> remove_member:<[index]>
                            - foreach stop
                        - define index <[index].add[1]>
                - remove <context.entity>
                - determine cancelled
#

Just cleaning up here

#

was told I don't need - define index <[index].add[1]>

#

Safe to remove? or do i need to put something else in

left geyser
#

you can remove it, but you will still need to replace it with <[loop_index]>

#

it's a special definition from the foreach command

plain laurel
#

Oh wait so im swapping it out for - define index <[loop_index]>

#

in the same spot?

left geyser
#

no

plain laurel
#

Yeah I didn't think so xD

left geyser
plain laurel
#
        on item_frame damaged by player:
            - if <context.entity.location.has_flag[lantern_of_warding].if_null[false]>:
                - actionbar "<&c>Warding Beacon Broken - Area unsafe"
                - spawn dropped_item[item=wardinglantern] <context.entity.location>
                - flag <context.entity.location> lantern_of_warding:!
                - define index 1
                - if <cuboid[lantern_of_warding_<player.world.name>].members_size> == 1:
                    - note remove as:lantern_of_warding_<player.world.name>
                - else:
                    - foreach <cuboid[lantern_of_warding_<player.world.name>].list_members> as:entry:
                        - if <[entry]> == <context.entity.location.flag[cuboid]>:
                            - adjust <cuboid[lantern_of_warding_<context.entity.location.world.name>]> remove_member:<[loop_index]>
                            - foreach stop
                - remove <context.entity>
                - determine cancelled
#

how we looking chief?

left geyser
#

you can remove the - define index 1 because it is not needed anymore now that you are using <[loop_index]>

plain laurel
#

Perfecto!

#

Now a question about indents

#
        on hanging breaks:
            - if <context.hanging.location.has_flag[lantern_of_warding]>:
               - determine cancelled

        on entity spawns in:lantern_of_warding_*:
        - if !<context.entity.is_monster>:
            - stop
        - playeffect effect:END_ROD at:<context.location> quantity:5 data:0.1
        - determine cancelled
#

Does the code operate differently on these 2 events? *based on the if indents

#

And does it matter using different indent methods in a whole file?

#

I know indents are important more so when inside of an if statement itself but i mean, like how the initial if is indented per event here.

left geyser
#

it doesn't matter what kind of indentation you use, as long as you indent things inside if, foreach, repeat, etc. more than the statement

# do this
- if <[test]>:
  - narrate yay

# not this (this will error
- if <[test]>:
- narrate yay
plain laurel
#

Yeah that makes sense, But for sense of code clarity, It would make sense to indent my ifs the same across events lol

left geyser
#

but it would probably look a lot cleaner if you stuck to the same initial indentation throughout the whole file

frosty hearth
plain laurel
#

So the on entity spawns is the correct way?

plain laurel
#

also should any of this be rate limited?

left geyser
plain laurel
#

I mean it doesn't as my entire code works fine but

#

I think it's just for clarity

plain laurel
frosty hearth
#

Ye

plain laurel
#

Had an interesting idea to add to my item :3

#

If a player right clicks the placed item. can i add particles around the borders of this bounding box?

#

so they can see the 'protected' area

left geyser
#

yeah that is possible

#

!t cuboidtag.shell

sturdy acornBOT
# left geyser !t cuboidtag.shell

Returns each block location on the 3D outer shell of the area.
This tag is useful for displaying particles or blocks to mark the boundary of the area.

Returns

ListTag(LocationTag)

Examples
# Spawns a hollow sphere of fire around the player.
- playeffect effect:flame at:<player.location.to_ellipsoid[5,5,5].shell> offset:0
plain laurel
#

So they right click it and it shows up for like 1 min

#

so they can double check where the protection goes to

#

oh nice

#

I'll do it on crouch right click as that doesn't 'change' it in anyway

#

Assuming thats possible too

#

on player right clicks item_frame:

#

!e sneak

sturdy acornBOT
# plain laurel !e sneak
Group

Player

Event Lines

player toggles|starts|stops sneaking

Triggers

when a player starts or stops sneaking.

Has Player

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

Context

<context.state> returns an ElementTag(Boolean) with a value of "true" if the player is now sneaking and "false" otherwise.

Has Known Location

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

Cancellable

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

left geyser
#

!t playertag.is_sneaking

sturdy acornBOT
plain laurel
#
        on player right clicks item_frame:
        - if <context.entity.location.has_flag[lantern_of_warding].if_null[false]> & <player.is_sneaking>:
#

So if it's the correct item, and if they are sneaking?

#

Wait &&

#

Yup that works all good

left geyser
#

you can use the with:<item> switch to check if they are using the right item

plain laurel
#

Oh they dont hold the item it's already on the floor

left geyser
#

oh mb

plain laurel
#

above code seems to work good ๐Ÿ˜„

left geyser
#

misread it :P

plain laurel
#

Now the event is good time to hurt my brain xD

#

If this exists. it means i am 100% inside of a bounding box

#

Oh wait

#

I already know the bounding box exact size from that point lol

#

So i don't need to 'access' the box, just do a particle effect of the same size lol

#
  • define cuboid <cuboid[<[loc].world.name>,<[loc].x.add[15]>,<[loc].y.add[15]>,<[loc].z.add[15]>,<[loc].x.add[-15]>,<[loc].y.add[-15]>,<[loc].z.add[-15]>]>
#
  • playeffect effect:flame at:<context.entity.location.to_ellipsoid[15,15,15].shell> offset:0
#

Time to figure out how to make these the same lol

plain laurel
#

Oh i know

#

I just mean thats the size of the box im trying to 'show'

timber flicker
#

yeah but do you know how to replace it lol

frosty hearth
plain laurel
#
  • playeffect effect:flame at:<context.entity.location.to_ellipsoid[15,15,15].shell> offset:0
#

Need to make this stay longer so i can actually SEE it

#

lmao

timber flicker
#

you just need to run it every so often

#

particles have a fixed lifetime

#

btw, those 2 tags aren't equivalent

#

if the ellipsoid works for you, that's great, but it's not the same shape as the cuboid

plain laurel
#

Yeah assuming i need .to_cuboid

#

Which might be invalid..

frosty hearth
#

You can add and substract from all x,y,z coordinates directly

plain laurel
#
- playeffect effect:flame at:<context.entity.location.to_cuboid[5,5,5].shell> offset:0
#

this shows me nothing?

stiff warrenBOT
frosty hearth
#

Adds 50 to x and z

plain laurel
#

The heck

stiff warrenBOT
plain laurel
#

o.O

#

I'm insanely bad at math xD

frosty hearth
#

This creates a cuboid around the spawn location

plain laurel
#

of 15 in each direction?

frosty hearth
plain laurel
#

My poor brain

#
- playeffect effect:flame at:<context.entity.location.to_cuboid[129,55,225,159,85,255].shell> offset:0
#

Surely not xD

timber flicker
#

to_cuboid takes 2 locations

plain laurel
#

Oh each far corner?

timber flicker
#

it creates a box around 2 corners

#

yes

plain laurel
#

umm

timber flicker
#

so you feed it one corner, and then the block 15 blocks away

#

and that makes the box

plain laurel
#

So

#
- playeffect effect:flame at:<context.entity.location.to_cuboid[15,-15].shell> offset:0
#

something like this?

frosty hearth
#

<context.entity.location. this is your first location

plain laurel
#

Yeah

frosty hearth
#

You have to specify the second location within [ ]

#

!t location.to_cuboid

sturdy acornBOT
plain laurel
#

Isnt that what im doing with [15,-15].shell>

frosty hearth
#

That's not a valid locationtag, no

frosty hearth
#

meta has an example which might make it clear

plain laurel
#
- note <player.location.to_cuboid[<npc.location>]> as:my_new_cuboid
#

So i have to feed it 2 tags?

#

for each corner?

#

opposite corner*

frosty hearth
#

2 tags, that return a location ye

plain laurel
#

Oh wait

#

<context.entity.location.add[15]>

#

something like this?

frosty hearth
#

!t location.add

sturdy acornBOT
plain laurel
#

I need a quick break I can't do math xD

frosty hearth
#

That's might be confusing for you now, but ye, you have to specify x,y,z

plain laurel
#
            - playeffect effect:flame at:<context.entity.location.to_cuboid[<context.entity.location.add[50,0,50]>,<context.entity.location.add[-50,0,-50]>].shell> offset:0
#

WHAT HAVE I DONE XD

frosty hearth
plain laurel
#

this is enough to make the brain stop processing

#
- playeffect effect:flame at:<context.entity.location.sub[15,15,15].to_cuboid[<context.entity.location.add[15,15,15]>]>
#

Wait no

#

Be back in a while, appreciate the patience ๐Ÿ‘

#
- playeffect effect:flame at:<context.entity.location.to_cuboid[<context.entity.location.add[5,0,5]>,<context.entity.location.sub[5,0,5]>].shell> offset:0

In my head, im playing a particle effect starting from the entity location(as a cuboid)

Then i'm specifying the 2 locations based on the entitys location

plain laurel
#

Yeah couldnt see anything

#

I ran it on 5,5,5 so it was closer too

#

But couldnt see it

frosty hearth
#

Did you check your console?

plain laurel
#

Yeah nothing in there

#

debug is on this script too

frosty hearth
#

!debug

sturdy acornBOT
# frosty hearth !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

plain laurel
frosty hearth
#

That's not nothing

#

At line 55 you see that it successfully creates a cuboid, so that part works

#

The console tells you what the issue is

unique urchin
#

holy crap you can specify a line when sharing pastebin pikasurprise

plain laurel
#
19:41:02  ERROR in script 'lantern_of_warding' in queue 'LANTERN_OF_WARDING_565909_IeeeMost' while executing command 'PLAYEFFECT' in file 'scripts/warding.dsc' on line '68' with player 'JoshJustGames'!
        Error Message: Woah! Invalid arguments were specified!
        Missing location argument! 
#
- playeffect effect:flame at:<context.entity.location.sub[15,15,15].to_cuboid[<context.entity.location.add[15,15,15]>]>
frosty hearth
#

Do you see what the issue is?

plain laurel
#

Well yeah i gathered this line is my issue but I dont see it lol

#
- playeffect effect:flame at:<context.entity.location.to_cuboid[<context.entity.location.add[5,0,5]>,<context.entity.location.sub[5,0,5]>].shell> offset:0
#

This is 2 locations

frosty hearth
plain laurel
#

Okay so back onto this line

#
- playeffect effect:flame at:<context.entity.location.sub[15,15,15].to_cuboid[<context.entity.location.add[15,15,15]>]>
frosty hearth
#

!t location.to_cuboid

sturdy acornBOT
frosty hearth
#

That's the tag you've used here, what does it return?

plain laurel
#

..

#

Returns a cuboid from this location to the specified location.

#

lmao

#

Oh wait

#

Right

#

So this is setting up the first position

#
            - playeffect effect:flame at:<context.entity.location.sub[15,15,15].to_cuboid
#

am i just missing .to_cuboid on the end of the last location?

frosty hearth
plain laurel
#

Nah i'm lost bro

frosty hearth
#

!guide first tags

plain laurel
#

Think I over thought the whole thing

sturdy acornBOT
plain laurel
#

Must have read that 5 times xD

frosty hearth
#

Read it slowly, and also TEST the examples

plain laurel
#

My brain decided it was probably too much for the item anyway tbh

unique urchin
plain laurel
#

Bit confused here

#

I need to give this denizen item as a crate command

#

I can run it via console but i can't figure out how to do that

#

I normally get the item with /ex give magnet

#

but as i'm the player running the command it works

#

Ah

#
  • 'exs give magnet player:%player%'
mild fable
#

!guide ex command

mild fable
#

!guide testing only

unique urchin
#

!c give

sturdy acornBOT
# unique urchin !c give
Group

item

Syntax

give [xp/<item>|...] (quantity:<#>) (unlimit_stack_size) (to:<inventory>) (slot:<slot>) (allowed_slots:<slot-matcher>) (ignore_leftovers)

Short Description

Gives the player an item or xp.

Description

Gives the linked player inventory items or xp.

Optionally specify a slot to put the items into. If the slot is already filled, the next available slot will be used.
If the inventory is full, the items will be dropped on the ground at the inventory's location.
For player inventories, only the storage contents are valid - to equip armor or an offhand item, use !command equip.

Specifying "unlimit_stack_size" will allow an item to stack up to 64. This is useful for stacking items
with a max...

plain laurel
#

I overlooked one thing..

#
    events:
        on player right clicks block with:item_flagged:lantern type:!air:
        - if <context.relative> == <context.location.add[0,1,0]> && !<context.location.add[0,1,0].has_flag[lantern_of_warding]>:
            - determine passively cancelled
#

This wont respect landclaims

#

F

#

Now that i think about it, they might even be able to do this in spawn lol

#

Yeah oof..

#

So i should be able to lock out the spawn world easily but

#

I need to find out if they own the claim or have build rights through GP plugin

#

Will handle worlds first

#

Okay worlds sorted, just the GP thing now

#

Actually yeah just need if the claim they are in = the name of whoever does this on player right clicks block

#
        on player right clicks block with:item_flagged:lantern type:!air in:Nearlands:
        - if <context.location.griefprevention.claim.owner> != <player>:
          - stop
#

I did a thing

plain laurel
#

Ran into some bizzare issue

#

Some blocks I click and it won't place? when it does place on a block there is no error

#

but when it wont place i get that error

#
        - if !<cuboid[lantern_of_warding_<player.world.name>].exists>:
            - note <[cuboid]> as:lantern_of_warding_<player.world.name>
        - else:
            - note <cuboid[lantern_of_warding_<player.world.name>].add_member[<[cuboid]>]> as:lantern_of_warding_<player.world.name>
#
 - note <[cuboid]> as:lantern_of_warding_<player.world.name>
#

Eh only happens in my testing ground when i was working with the script all messed up so probably some left over stuff

frosty hearth
#

Holy cow has this thread really 1420 messages lol

#

Anyway, per your debug record it shows that you're using a definition <[cuboid]> that weren't defined yet

#

So you probably want to define it first?

left geyser
hollow quailBOT
#
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.)

#

@plain laurel