#(hy1lite) how to use another plugin command in denizen
45 messages · Page 1 of 1 (latest)
(hy1lite) how to use another plugin command in denizen
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.
!c execute
server
execute [as_player/as_op/as_npc/as_server] [<Bukkit-command>] (silent)
Executes an arbitrary server command as if the player, NPC, or server typed it in.
Allows the execution of server commands through a Denizen script.
Commands can be executed as the server, as an npc, as an opped player, or as a player, as though it was typed by the respective source.
Note that you should generally avoid using 'as_op', which is only meant for very specific special cases. 'as_server' is usually a better option.
Note: do not include the slash at the start. A slash at the start will be interpreted equivalent to typing two slashes at the front in-game.
Note that...
how to correctly write a command on behalf of the server?
But make sure you actually need that, a lot of stuff can be done with just Denizen code / have built-in integrations
is there an example?
^ Please read the meta I pulled up, it has an explanation and examples
Click the blue link to open the meta website with the full info
But ^ a lot of plugins have built-in integrations, which is preferred over directly executing commands
Another question is whether it can be used in execute <player>?
to get player name
I have corrected
but I have another question: how to do on player right clicks entity: change entity to player
!vague
Your question is too vague to be able to answer well.
If you're asking how to do something, please make sure to add some background detail. Make sure to specify your overall end goal and the general design/idea and any existing progress towards that goal, not just the single specific point.
For script-related problems, see also !info haste debug. For non-scripting server trouble, see !logs.
See also !xyproblem
What do you mean "change to player"? spawn a player NPC?
That doesn't tell me much still ;-; - what should actually happen in the world?
Does the player that clicked switch places with the entity?
Does a player NPC spawn there in place of the entity?
how to correctly replace an entity with a player
Sorry, I'm writing from a translator
I don't understand what are you trying to make, replace an entity with a player doesn't say much :/
What player, for example? is it the player clicking? or a different one? or a player NPC?
The essence of what I want is if a player with the Shift key pressed on another player, the script is played, but the problem is that if I write an entity, then any entity, a cow or a player, is triggered, but I only need the player
I don’t know if my words are translated correctly, but I hope you understand me
Oh, you want the event to only run when you right click a player?
!e player right clicks entity
Player
this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.
player right clicks <entity>
with:<item> to only process the event when the player is holding a specified item.
type:<entity> to only run if the entity clicked matches the entity input.
when a player right clicks on an entity.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.entity> returns the EntityTag the player is clicking on.
<context.item> returns the ItemTag the player is clicking with.
<context.hand> returns "offhand" or "mainhand" to indicate which hand was used to fire the event. ...
<context.click_position> returns a LocationTag of the click position (as a world-less vector, rela...
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
<entity> means it takes an entity matcher, which can also be player
Yes
So you can just do player right clicks player
I just don’t know how to do this, the player just doesn’t work
the meta says:
Event Lines
player right clicks <entity>
replace <entity> with player, literally
so instead of typing player right clicks entity,
you would type player right clicks player
after saving the script file, /ex reload in-game, and debug it by trying to right click a player
!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!