Remove "this" item plugin

Discussion in 'Archived: Plugin Requests' started by ravi., Aug 30, 2012.

  1. Offline

    ravi.

    How it works:
    I never found a plugin which gives you the possibility to remove a specific item (and specific amount of it), IF the player has the item. (+Maybe there could be a text message if not.)

    The plugin could either be used for simple trading mechansim or to remove specific items in areas, in which you dont want the player to have those items. (In my case, it's once again needed for a game I build in mc. At the start, the player get different tools, but at the end I want to remove it again.)

    Commands:

    /iremove <player> <item-id> <amount> (<txt-msg>)

    note <player> : It would be great if you either could use the players name or just <player> for anybody

    note <txt-msg>: "command added by players choice", maybe the player dont want to display the text message, in that case it would be nice not to be forced to use it

    ...and:

    I haven't found such a plugin yet, please let me know if I overlook something! (please no trading/merchandise plugins)

    sorry for my bad english, I hope you understand what I mean.

    Thank you for reading!:)
     
  2. Offline

    Pippiter69

    Just use the inventory open plugin, you can easily take items out from there.
     
  3. Offline

    ravi.

    Thank you, but I know this plugin already, and it's not what I mean. You should be able to remove items from player per command, so you could use it with other plugins (such as serversigns), which execute commandlines just by clicking a certain point.

    This plugin only provides manual inventory changes.

    but thank you so far...
     
  4. Offline

    TobyG123

    Ill try to do it. I am currently learning java and could try.... However I think someone else should do it. I probably wont be successful. :p
     
  5. Offline

    Njol

    You could use Skript with the following script:
    Code:
    command /iremove <items> from <player> [because <text>]:
      permission: your.permission.here
      description: Removes items from the given player, optionally notifing them why.
      trigger:
        player-argument has item-argument:
          remove item-argument from the player-argument
          message "Successfully removed %item-argument% from %player-argument%"
          if text-argument is set:
            send "%item-argument% was taken away from you because %text-argument%"
        else:
          message "%player-argument% doesn't have %item-argument%!"
    
    You could then use this command like "/iremove a diamond pickaxe from Njol because you stole it!".

    If you want to be able to remove items from all players on the server or in a specific area i suggest to create another command.
     
    ravi. likes this.
  6. Offline

    ravi.

    Hey, thank you, espacially Njol! I already downloaded "Skript" a day ago or so :) and it sounds very nice! I will try it soon! Would be great if it works!

    many Thanks!

    Hey Njol. I tried to install Skript on my server but it dont extract the jar-file. Therefore I have no Skript-folder. What can I do? :( Your plugins sounds so cool!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  7. Offline

    Njol

    Did you download the zip or the jar? The jar is only useful if you're updating as Skript doesn't generate the config file automatically (the zip also comes with a few example scripts).
     
  8. Offline

    ravi.

    Thank you, I just download the zip!

    I gave it a try, your example scripts, like the "drop fixer" work fine, but your script for item removing doesn't seem to work right. :( I tried to figure out where the error is, but can't find it.
    Although I will invest some more time on your plugin and maybe find a way to make my script work, your plugin seems very comfortable to me. (fortunately I dont have to learn java...:p)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  9. Offline

    vsams14

    I could write this as a plugin. It's actually very simple. Do you still need it?
     
  10. Offline

    ravi.

    Code:
    else:
          message "%player-argument% doesn't have %item-argument%!"
    this was the failure. without this line it work's fine. Where it's supposed to be?

    I have alread a much fun with the "Skript" plugin, thank you once again. Is there a way to prevent a entity from moving? Sadly there is no "on move" event or "stop" condition...

    vsams14: Although I try to do it by my own yet, using the Skript-plugin, I would appreciate it, if it's no big deal for you! :)
     
    vsams14 likes this.
  11. Offline

    vsams14

    You can definitely prevent an entity from moving in an actual plugin... Do you want to disallow the target player from moving, or...?

    Ok! I should have it for you by Monday. I'm a student, so I might have a lot of work, but I'll try to get some time in!
    I hope that deadline is suitable?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  12. Offline

    ravi.

    I was experimenting with the "Skript" plugin and was wondering if there is a way to prevent a entity from moving (in that case a villager, I spawned using the Skript before). I like the idea of "Skript", to easily make simple scripts instead of hoarding many mini plugins, which you eventually could bundle in one script.

    vsams14: Would be very great! Don't stress, I have the time! ;)

    Njol: Is there a way to make an "amount" command? I tried it, but it doesn't work... It should be possible to remove all items of a specific kind. Now you just can type a number and hope that the player has this amount of item, because when you want to remove "to much", it wont remove anything. So there must be a check of the number of items the player possess or the possibility to remove all.

    Code:
    command /iremove <items> from <player> [because <text>]:
    and the "s" in the word "items" was wrong... scripting textes, everytime such little failures...:p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  13. Offline

    Njol

    You should be able to use the command like "/remove all pickaxes from ..." to remove any pickaxe from the specified player. This way you don't need to worry about numbers, just remember the 'all' if you want to remove all items of a kind instead of a certain amount.
     
  14. Offline

    ravi.

    Code:
    command /iremove <item> from <player> [because <text>]:
      description: Removes items from the given player, optionally notifing them why.
      trigger:
        player-argument has item-argument:
          remove all item-argument from the player-argument
          message "Successfully removed all %item-argument% from %player-argument%"
          if text-argument is set:
            send "All %item-argument% was taken away from you because %text-argument%"
    I tried this yesterday, but it doesn't work. I also tried to add <amount> to the commandline and added the "amount-argument" below as well (at the right place I think), but it don't work either.

    And is there a way to prevent an entity from moving? Maybe directly with the "on spawn:" event?
     
  15. Offline

    Njol

    I fixed the command and tested it this time:

    Code:
    command /iremove <items> from <player> [because <text>]:
      permission: your.permission.here
      description: Removes items from the given player, optionally notifing them why.
      trigger:
        player-argument has items-argument:
          remove items-argument from the player-argument
          message "Successfully removed %items-argument% from %player-argument%"
          if text-argument is set:
            send "%items-argument% was taken away from you because %text-argument%" to player-argument
        else:
          message "%player-argument% doesn't have %items-argument%!"
    
    The problem was that 'item' is not the same as 'items' ^^
     
  16. Offline

    ravi.

    Yes, If igured it out some posts ago. ;)

    but thanks anyway :)
     
  17. Offline

    Njol

    Oops didn't really see that post :rolleyes:. But you changed it the wrong way around: you should use 'items' everywhere instead of 'item' - that way you can e.g. use 'all pickaxes' as argument.

    But as stated the script I posted works so you can simply use that one and can e.g. "/iremove everything from njol because your first script didn't work" ;)
     
  18. Offline

    ravi.

    Now I also understand why the "all" argument weren't working!
    thank you! :)
     
  19. Offline

    vsams14

    So... I guess that means I don't need to write a plugin for this?
    If you ever do need something written, I'm always available on bukkitDev!
     
  20. Offline

    ravi.

    thank you vsams14, I think you don't need to write this plugin. I will keep it in mind, if I ever need your help! thank you anyway!
     

Share This Page