OtherDrops

226k Downloads

Exucute a command in a drops

salvokt opened this issue ยท 14 comments

commented

is possible to add a command on a book and when it will ve used it disappear??

commented

You could execute a command on rightclick based on the displayname (lorename) of the book held, eg:

   ANY:
    - action: rightclick
      tool: book
      lorename: blah
      command: "/!*runme"
      toolconsume: 1
commented

afterthis the book disappear?

commented

Yes, if you use the toolconsume parameter. Forgot to add that, I just editted the example above.

commented

hmm.. no errors, but it does nothing... not really sure you can rightclick a plain book anyway. A signed and written book (WRITTEN_BOOK), however would be nice in that the player would expect to hold it and then rightclick to read it. Upon which, the text would inform them that they had just been cursed, they'd get poisoned and blinded and would thus die ... ;-)

commented

It's not rightclicking a book - it's rightclicking on any block (or mob) with a "book" as the tool, so should work fine although I haven't had a chance to test it yet (not currently at home).

A written book should work fine too - and would be nice to make the title a condition, eventually :)

commented

yes - i am clicking blocks with the book in hand as a tool. Does nothing...

commented

well, LEFT_CLICK while holding a book or written_book in hand works great. But usually players don't use books as tools to hit things or try to break things. so it seems just RIGHT_CLICK isn't working, likely because, with books - right clicking is used to read the book itself, and not to act upon a block like some other things can...

commented

this sounds fun, but:

[WARNING] [OtherDrops:2.8b.382] Unrecognized target (skipping): BOOK
commented

Oops, it was late :D Fixed the example above.

commented

other drops is compatible with epicboss?

commented

@salvokt Should be, in regards to commands at least - OtherDrops can run the commands from any plugin that you want.

@somaticstudios Ah, of course, hadn't been thinking of a book rightclick taking effect before the playerinteractevent. It'll have to be on the leftclick unless I add a trigger for BOOKREAD or something.

commented

is possible to add custom drops to custom mobs created with epicboss
thanks for reply

commented

BOOKREAD trigger would make the scenario I imagined above possible.. yes please ;-) just make sure it supports delay on the drop so I can give them a chance to read what horrors are about to befall them...

commented

I've tested this recently - the rightclick trigger still works for a written book even though the book opens up.

@somaticstudios - so it's quite possible to do the open, read text and be cursed/poisoned part :)

  WRITTEN_BOOK:
    - action: RIGHTCLICK
      delay: 60
      potioneffect: POISON@200@2
      message: "The curse has taken effect!"