#(Niklas) open players inventory
130 messages · Page 1 of 1 (latest)
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>
!c inventory
item
inventory [open/close/copy/move/swap/set/keep/exclude/fill/clear/update/adjust <mechanism>:<value>/flag <name>(:<action>)[:<value>] (expire:<time>)] (destination:<inventory>) (origin:<inventory>/<item>|...) (slot:<slot>)
Edits the inventory of a player, NPC, or chest.
Use this command to edit the state of inventories.
By default, the destination inventory is the current attached player's inventory.
If you are copying, swapping, removing from (including via "keep" and "exclude"), adding to, moving, or filling inventories,
you'll need both destination and origin inventories.
Origin inventories may be specified as a list of ItemTags, but destinations must be actual InventoryTags.
Using "open", "clear", or "update" only require a destination.
"Update" also req...
use the open arg
- inventory open d:<player.target.inventory>
(should ideally check if the player has a target, and that the target is a player)
!guide handling player commands
View the guide page 'Handling Player Commands' at: https://guide.denizenscript.com/guides/basics/player-commands.html
yes of course
well..
type: command
name: looten
usage: /looten
description: loot
script:
- define open <player.location.find_players_within[2]>
- if <[open].has_flag[bewusstlos]>:
- if !<player.target.is_npc>:
- inventory open d:<[open]>```
Content of Server Log Paste #110480: Denizen Debug Logs From Gemmeria Mittelalter RP Starte dein Abenteuer noch heute.... pasted 2023/05/30 10:40:32 UTC-07:00, Paste length: 4989 characters across 46 lines, Content: Java Version: 17.0.1Up-time: 14h 20m
can anybody help me with this
it opens my inv
use the.. player.target? and check if its not null
I dont know why you're using <player.location.find_players_within[2]>
Because I have armorstands above the player....
!t ray_trace
Multiple possible tags: <LocationTag.ray_trace[(range=<#.#>/{200});(return=<{precise}/block/normal>);(default=<{null}/air>);(fluids=<true/{false}>);(nonsolids=<true/{false}>);(entities=<matcher>);(ignore=<entity>|...);(raysize=<#.#>/{0})]>, <LocationTag.ray_trace_target[(range=<#.#>/{200});(blocks=<{true}/false>);(fluids=<true/{false}>);(nonsolids=<true/{false}>);(entities=<matcher>);(ignore=<entity>|...);(raysize=<#.#>/{0})]>.
!t location.ray_trace
Traces a line from this location towards the direction it's facing, returning the location of the first hit block or (optionally) entity.
This tag has also been referred to as 'cursor_on' or 'precise_cursor_on' in the past.
For ray tracing entities, see !tag LocationTag.ray_trace_target.
Using 'return=normal' instead replaces the old 'precise_impact_normal' tag.
Optionally specify:
range: (defaults to 200) a maximum distance (in blocks) to trace before giving up.
return: (defaults to prec...
world
LocationTag
# Destroys whatever solid block the player is looking at.
- define target <player.eye_location.ray_trace[return=block]||null>
- if <[target]> != null:
- modifyblock <[target]> air
# Spawns a heart wherever the player is looking, no more than 5 blocks away.
- playeffect effect:heart offset:0 at:<player.eye_location.ray_trace[range=5;entities=*;ignore=<player>;fluids=true;nonsolids=true;default=air]>
and more... Check the website for more examples
You can exclude armor stands
thats not the correct tag one moment
!t location.ray_trace_target
Traces a line from this location towards the direction it's facing, returning the first hit entity (if any).
This is similar to !tag LocationTag.precise_target and !tag PlayerTag.target, except offering more options for how the ray trace is performed.
For ray tracing locations, see !tag LocationTag.ray_trace.
Optionally specify:
range: (defaults to 200) a maximum distance (in blocks) to trace before giving up.
blocks: (defaults to true) specify "false" to ignore all blocks, ...
world
EntityTag
# Removes the entity a player is looking at.
- define target <player.eye_location.ray_trace_target[ignore=<player>]||null>
- if <[target]> != null:
- remove <[target]>
# Returns any player within the view of an NPC.
- define target <npc.eye_location.ray_trace_target[entities=player;raysize=2]||null>
# Highlights an entity through any number or types of blocks.
- define target <player.eye_location.ray_trace_target[ignore=<player>;blocks=false]||null>
- if <[target]> != null:
- adjust <[target]> glowing:true
This is the one
- define open <player.location.ray_trace_target[ignore=[armor_stand];blocks=false]>
like this
ignore is for specific entities, to ignore armor stands in general you'd want to specify a matcher using entities=
ok... well. I still dont know how to get this run.
I think I will just du: execute as_op "inventory open <player.target>"
that wont work
yeah....
you want only players right
yeah
so use the matcher aya provided
with player as value
I mean
its literally an example
Content of Denizen Script Paste #110496: Unnamed Denizen Script Paste... pasted 2023/05/30 11:33:16 UTC-07:00, Paste length: 324 characters across 9 lines, Content: looten: type: command
doesnt work... Debug incoming
Content of Server Log Paste #110497: Denizen Debug Logs From Gemmeria Mittelalter RP Starte dein Abenteuer noch heute.... pasted 2023/05/30 11:33:34 UTC-07:00, Paste length: 5203 characters across 50 lines, Content: Java Version: 17.0.1Up-time: 15h 13m
only error
Yeah so
Content of Server Log Paste #110497: Denizen Debug Logs From Gemmeria Mittelalter RP Starte dein Abenteuer noch heute.... pasted 2023/05/30 11:33:34 UTC-07:00, Paste length: 5203 characters across 50 lines, Content: Java Version: 17.0.1Up-time: 15h 13m
This tag returned null
so it doesn't have any player attached
And <player> is not a valid argument in the inventory command
specifically, you don't need it at all
you alreaay have d:<[open]>
which is the destination
probably want .inventory attached on it after you verified the input
aaaaaalso
<player.location.ray_trace_target[entities=player,raysize=2]||null>
this isn't valid
do you see in the example that it's separated by a semicolon?
you used a , which borked the tag
Content of Denizen Script Paste #110498: Unnamed Denizen Script Paste... pasted 2023/05/30 11:38:09 UTC-07:00, Paste length: 279 characters across 8 lines, Content: looten: type: command
does it worky worky now?
no.
Content of Server Log Paste #110499: Denizen Debug Logs From Gemmeria Mittelalter RP Starte dein Abenteuer noch heute.... pasted 2023/05/30 11:38:22 UTC-07:00, Paste length: 4197 characters across 43 lines, Content: Java Version: 17.0.1Up-time: 15h 18m
doesnt change anything. still doesnt work.
Do you know the answer and just want me to learn it?
currently I'm not sure why its not working
another helperino might know
Content of Denizen Script Paste #110502: Unnamed Denizen Script Paste... pasted 2023/05/30 11:51:04 UTC-07:00, Paste length: 263 characters across 8 lines, Content: looten: type: command
Content of Server Log Paste #110501: Denizen Debug Logs From Gemmeria Mittelalter RP Starte dein Abenteuer noch heute.... pasted 2023/05/30 11:50:26 UTC-07:00, Paste length: 4680 characters across 45 lines, Content: Java Version: 17.0.1Up-time: 15h 30m
I think I am just gonna remove the loot feature.
I hate it... It just wont work.
just remove it
script:
- define players <player.location.find_npcs_within[3]>
- if <[players].has_flag[bewusstlos]>:
- inventory open d:<[players].name.inventory>
<player.location.find_npcs_within[3]> finds NPCs within 3 blocks of the player location
if <[players].has_flag[bewusstlos]> will never return true,
<[players]> is a list of NPCs within 3 blocks
a list that is "me, you, and icecapade" does not have a flag
if you want to check if any of those NPCs have a flag, you'd filter it
- if <[players].filter[has_flag[bewusstlos].is_empty>:
- narrate "no players have this flag"
if you want to open the inventory of the One person who Does have this flag:
<[players].filter[has_flag[bewusstlos]]> will return a list of players who Do
<[players].filter[has_flag[bewusstlos]].first> will return the first NPC in this tag who has the flag
- inventory open destination:<[players].filter[has_flag[bewusstlos]].first.inventory> opens that NPC's inventory
be mindful that i'm saying NPC because you wrote in your first tag find_npcs_within
if you actually meant players, you want find_players_within
Hab a little break smashink the sh out of my wall. Now i will try this.
Content of Denizen Script Paste #110506: Unnamed Denizen Script Paste... pasted 2023/05/30 12:21:34 UTC-07:00, Paste length: 345 characters across 10 lines, Content: looten: type: command
Content of Server Log Paste #110505: Denizen Debug Logs From Gemmeria Mittelalter RP Starte dein Abenteuer noch heute.... pasted 2023/05/30 12:20:23 UTC-07:00, Paste length: 3257 characters across 36 lines, Content: Java Version: 17.0.1Up-time: 16h
still doesnt work
what does "doesnt work" mean? you open an empty inventory? are you sure those npcs actually have an inventory (/npc equip does not populate any inventories)
also...
I absolutly dont know...
I will take a break and try It again tomorrow
Hey if you actually was being serious here please take a break for your mental health
Jeah thats what i am doing now thx
ok back to this.
could you explain how I ruined it?
Try to go line-by-line and seeing how would the code run - in this case, you do if <something>, then if that passes you - stop
Since you - stop in the if, anything after it will only run if the if didn't
So using else is pointless there, can just have the code after the if
That style is called early return, where instead of having
if <y>:
if <z>:
the code here
you have
if !<x>:
stop
if !<y>:
stop
if !<z>:
stop
the code here
which generally is a lot cleaner and more readable
- define players <player.location.find_npcs_within[3]>
- if <[players].filter[has_flag[bewusstlos]].is_empty>:
- narrate "<gold>Gemmeria-Kampf <&8>| <&7>Kein bewusstloser Spieler"
- else:
- inventory open d:<[players].filter[has_flag[bewusstlos]].first.inventory>```
this better?
it now narrates that there is no player flagged bewusstlos
no doesnt work
You can change it to a narrate if you want to, Mergu's comment was on your previous script where you used - stop
But uh, you're using find_npcs_within, that won't return players
!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!
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.)
@red vessel