#(hy1lite) how to use another plugin command in denizen

45 messages · Page 1 of 1 (latest)

wind bobcat
#

up

desert loomBOT
#

(hy1lite) how to use another plugin command in denizen

desert loomBOT
#

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.

waxen atlas
shrewd acornBOT
# waxen atlas !c execute
Group

server

Syntax

execute [as_player/as_op/as_npc/as_server] [<Bukkit-command>] (silent)

Short Description

Executes an arbitrary server command as if the player, NPC, or server typed it in.

Description

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...

wind bobcat
#

how to correctly write a command on behalf of the server?

waxen atlas
#

But make sure you actually need that, a lot of stuff can be done with just Denizen code / have built-in integrations

wind bobcat
#

is there an example?

waxen atlas
# shrewd acorn

^ 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

waxen atlas
wind bobcat
#

to get player name

wind bobcat
#

but I have another question: how to do on player right clicks entity: change entity to player

shrewd acornBOT
# waxen atlas !vague
Info: 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

waxen atlas
#

What do you mean "change to player"? spawn a player NPC?

wind bobcat
#

sec

#

sry

#

how to correctly replace an entity with a player

waxen atlas
#

Does the player that clicked switch places with the entity?

#

Does a player NPC spawn there in place of the entity?

wind bobcat
#

how to correctly replace an entity with a player

#

Sorry, I'm writing from a translator

waxen atlas
#

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?

wind bobcat
#

I don’t know if my words are translated correctly, but I hope you understand me

waxen atlas
#

!e player right clicks entity

shrewd acornBOT
# waxen atlas !e player right clicks entity
Group

Player

**WARNING**

this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.

Event Lines

player right clicks <entity>

Switches

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.

Triggers

when a player right clicks on an entity.

Has Player

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

Context

<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...

Has Known Location

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

Cancellable

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

waxen atlas
#

<entity> means it takes an entity matcher, which can also be player

wind bobcat
#

Yes

waxen atlas
#

So you can just do player right clicks player

wind bobcat
#

I just don’t know how to do this, the player just doesn’t work

slow cosmos
#

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

shrewd acornBOT
# slow cosmos !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!