after player clicks rotate_15_item in entity_manipulator_inventory:
- if <player.item_in_hand> == <item[entity_manipulator_item]>:
- flag <player.item_in_hand> test
- narrate "Rotate Target: (15 Degrees) Selected!"
- inventory close
## Triggered Logic
on player animates ARM_SWING with:entity_manipulator_item:
- if <player.target.exists>:
- if <player.item_in_hand.has_flag[test]>:
- narrate <player.item_in_hand>```
#(Skullfurious) Can you flag an item in the player's inventory?
49 messages · Page 1 of 1 (latest)
(Skullfurious) Can you flag an item in the player's inventory?
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
Group
item
Syntax
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>)
Short Description
Edits the inventory of a player, NPC, or chest.
Description
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...
!guide adjust command is not
View the guide page 'Common Mistakes - The Adjust Command Is Not For Items/Materials/Etc.' at: https://guide.denizenscript.com/guides/troubleshooting/common-mistakes.html#the-adjust-command-is-not-for-items-materials-etc
View the guide page 'Common Mistakes - Don't Compare Raw Objects' at: https://guide.denizenscript.com/guides/troubleshooting/common-mistakes.html#don-t-compare-raw-objects
Resolved
Thread closed as resolved.
Sorry to reopen this. But I have a question. I think I'm flagging the item properly now, but I can't seem to retrieve the flag from the item.
# Set Active Manipulation Flag:
after player clicks rotate_15_item in entity_manipulator_inventory:
- if <player.item_in_hand> matches entity_manipulator_item:
- inventory flag slot:hand active_manipulator:rotate_15_item
- inventory close
# Triggered Logic
on player animates ARM_SWING with:entity_manipulator_item:
- if <player.target.exists>:
- if <player.item_in_hand.flag[active_manipulator]>:
- narrate <player.item_in_hand>
Changed to Help/Support
Thread is now a Help/Support thread. A helper will check your thread when available.
(Am I allowed to use /helpthread to reopen a thread?)
Should have checked first, sorry.
Content of Denizen Script Paste #107204: Unnamed Denizen Script Paste... pasted 2023/03/10 21:13:09 UTC-08:00, Paste length: 2547 characters across 73 lines, Content: entity_manipulator_item: debug: false
you want .has_flag
you're giving the active_manipulator flag a value of rotate_15_item
you can't do if rotate_15_item
because thats what you're doing, you're using an if on the flag's value
yes
@exotic valley Ah, right. I fixed that, thank you.
For some reason however...
- narrate <player.item_in_hand.flag[active_manipulator]>``` just prints out the whole line as if the tag is formed incorrectly. Is that not how you get the flag value?
Do some debugging and watch ya console /ex narrate <player.item_in_hand.has_flag[active_manipulator]>
!guide solving problems
View the guide page 'Solving Problems You Encounter' at: https://guide.denizenscript.com/guides/first-steps/problem-solving.html
Oh, for some reason on player scrolls is grabbing the item that was in hand previously
so i might have to do after
yep that does it, sorry about that.
!e scrolls their hotbar
Group
Player
Event Lines
player scrolls their hotbar player holds item
Switches
item:<item> to only process the event when the player is going to hold a specified item.
Triggers
when a player scrolls through their hotbar.
Has Player
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
Context
<context.new_slot> returns the number of the new inventory slot.
<context.previous_slot> returns the number of the old inventory slot.
Has Known Location
True - this adds switches in:<area> + location_flagged:<flag name>.
Cancellable
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
I have the item switch already
after player scrolls their hotbar item:entity_manipulator_item:
but when you use on it still has the old item in hand i guess
when you use after it is correct
But <context.new_slot> might be a lot more safe
item:<item> to only process the event when the player is going to hold a specified item.