#(realjimmyb) Access flag stored inside a variable
58 messages · Page 1 of 1 (latest)
(realjimmyb) Access flag stored inside a variable
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.
if it's set through the define command, you can use <[variable]> to get the value
if <[currchunk]>.flag[chunk_domainnameflag]> != player.flag[player_domainnameflag]:
This is what I've got, currchunk is the variable
uhh... couple issues
Great! please help, I've been struggling with variable syntax all day
<[currchunk]>.flag[chunk_domainnameflag]> isn't a valid syntax, as there can only be one > for each <
player.flag[player_domainnameflag] also only returns the plain-text value, since it's not surrounded by <>
!c define usage
queue
define [<id>](:<action>)[:<value>]
Creates a temporary variable inside a script queue.
- narrate "You invoke your power of notice..."
- define range <player.flag[range_level].mul[3]>
- define blocks <player.flag[noticeable_blocks]>
- define count <player.location.find_blocks[<[blocks]>].within[<[range]>].size>
- narrate "<&[base]>[NOTICE] You have noticed <[count].custom_color[emphasis]> blocks in the area that may be of interest."
- define target <server.match_player[<context.args.get[1]>]||null>
- if <[target]> == null:
- narrate "<red>Unknown player target."
- stop
- narrate "You targeted <[target].name>!"
- define arg1 <context.args.get[1]>
- if <[arg1]> == hello:
- narrate Hello!
- else if <[arg1]> == goodbye:
- narrate Goodbye!
- define myDef:!
- define myroot.mykey MyValue
- define myroot.myotherkey MyOtherValue
- narrate "The main value is <[myroot.mykey]>, and the map's available key set is <[myroot].keys>"
[18:24:29 INFO]: Additional Error Info: Tag <[currchunk].flag[chunk_domainnameflag]> is invalid!
I'm sorry I should have seen that first one..
what is the definition of currchunk
Don't post error snippets, post debugs/script pastes which would have the full context we need to help you out
define currchunk <chunk[<[new_player_chunk_temp_str]>,world4]> ---------+
[18:26:10 INFO]: Filled tag <[new_player_chunk_temp_str]> with '148,-108'.
[18:26:10 INFO]: Filled tag <chunk[148,-108,world4]> with 'ch@148,-108,world4'.```
!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!
Content of Denizen Script Paste #135641: Chunk loading and tracking... pasted 2025/08/18 17:29:09 UTC-07:00, Paste length: 5387 characters across 121 lines, Content: assignplayerchunklogin: type: world debug: true events:
can you run a debug of you running through the segment that's giving you an error/issues?
Content of Server Log Paste #135642: Denizen Debug Logs From A Minecraft Server... pasted 2025/08/18 17:32:52 UTC-07:00, Paste length: 14851 characters across 127 lines, Content: `Java Version: 21.0.8 Up-time: 3h 28m Denizen Version: Core: 1.91.0-SNAPSHOT (Build 1403), Spigot: 1.3.1-SNAPSHOT (build 7197-DEV) Script Containers: 12,...
.flag<[chunk_domainnameflag]>> also isn't valid syntax
Yeah I figured
does removing the excess <> fix the issue?
Content of Denizen Script Paste #135641: Chunk loading and tracking... pasted 2025/08/18 17:29:09 UTC-07:00, Paste length: 5387 characters across 121 lines, Content: assignplayerchunklogin: type: world debug: true events:
On line 1: Invalid YAML! Error message: While scanning a mapping, found invalid tab as indentation.
On line 55: Script section within command is empty (add contents, or remove the section).
On line 2: This script uses the raw tab symbol. Please switch these out for 2 or 4 spaces.
On line 51, 53, 54, 55: Uneven number of tag marks (forgot to close a tag?).
On line 38, 106: Pointless quotes (arguments quoted but do not contain spaces).
On line : (Statistics) Total structural lines: 10
On line : (Statistics) Total live code lines: 72
On line : (Statistics) Total comment lines: 12
On line : (Statistics) Total blank lines: 15
There are 4 lines that were merged into other lines.
Nope, still invalid
<[currchunk].flag[chunk_domainnameflag]> is invalid!
I just have no idea how to structure the < and [ when using a variable
Yes, I confirmed that
can you run another debug that includes the chunk being flagged, and the script that produces this error?
Sure, but it's going to be very long, just a heads up. I can point you to the lines where the interesting bits happen
I'm focused on chunk 152, -111.
https://paste.denizenscript.com/View/135644 - debug
https://paste.denizenscript.com/View/135645 - full script
Content of Server Log Paste #135644: Denizen Debug Logs From A Minecraft Server... pasted 2025/08/18 17:53:29 UTC-07:00, Paste length: 3811448 characters across 8778 lines, Content: `Java Version: 21.0.8 Up-time: 3h 48m Denizen Version: Core: 1.91.0-SNAPSHOT (Build 1403), Spigot: 1.3.1-SNAPSHOT (build 7197-DEV) Script Containers: ...
Content of Denizen Script Paste #135645: chunk tracking and reading yaml... pasted 2025/08/18 17:54:40 UTC-07:00, Paste length: 5444 characters across 122 lines, Content: assignplayerchunklogin: type: world debug: true events:
Hold on the debug cut most of it off, I'll redo
Content of Server Log Paste #135646: Denizen Debug Logs From A Minecraft Server... pasted 2025/08/18 17:56:34 UTC-07:00, Paste length: 3789410 characters across 8598 lines, Content: `Java Version: 21.0.8 Up-time: 3h 51m Denizen Version: Core: 1.91.0-SNAPSHOT (Build 1403), Spigot: 1.3.1-SNAPSHOT (build 7197-DEV) Script Containers: ...
Oh I think I see the issue
You're checking chunk 151,-111, but not flagging it
I see you flagging 152,-111 but not 151,-111
Yeah I saw that too, it looks like the process actually worked for 152,-111. I'm curious why the title on line 8564 fails to read out the value inside the flag then
I've probably got the syntax on line 51 of the script screwed up
If there's no flag set, the tag will return null
It doesn't return null though, it returns a big literal string
title='ch@152,-111,world4.flag[chunk_domainnameflag]>'
That's null
Oh
If there's no value, it'll return the literal text of the tag that errored
For instance:
so the syntax is right, but the flag isn't set properly?
@nocturne smelt <server.match_player[mcsamuel]>
Tag parse results for <server.match_player[mcsamuel]>: https://paste.denizenscript.com/View/135647
server.match_player[mcsamuel]
Had error: Tag <server.match_player[mcsamuel]> is invalid!
Had error: Unfilled or unrecognized sub-tag(s) 'match_player[mcsamuel]' for tag <server.match_player[mcsamuel]>!
Had error: The returned value from initial tag fragment 'server' was: '(Base-Object)'.
Had error: Almost matched but failed (possibly bad input?): match_player
Correct, the chunk doesn't have the flag
Hmm, but the title is returning a null then for 152,-111 as well
I can't take a close look rn as I have somewhere to be soon, but I'll take a look when I get back if someone else isn't able to assist
Well I confirmed the tag works when I check for the flag stored on the chunk, now it seems that the value stored on the player is incorrect.
No worries, thank you so much for the help I really appreciate it