Inactive [MECH/FUN] ItemDetector v1.2 - An Item-detecting gate [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Streammz, Apr 25, 2011.

  1. ItemDetector - Gates which detect items
    Version: v1.2

    With this plugin, you can make item detecting gates, just like at the airports.
    It uses redstone, so combined with other plugins you can make traps, falls etc.
    On the end of this post there is an detailed instruction on how to create them.
    This uses NO commands.

    • Creating gates which can be used to detect items
    • Redstone support by changing torches into redstone torches.
    • Detect multiple items (good for an pvp-zone to detect swords/bows etc)
    • Block people from entering with specific items
    • Minecart support
    • Clearing inventory's
    • Permission support
    • Message / kit support

    V1.1 - Download
    V1.2 - Download
    Addon kit - Download
    ItemDetector is open source! (NO RE-RELEASES WITHOUT PERMISSION)

    Known bugs:
    If itemdetector is loaded before multiworlds, it will get a nullpointer and lose all data, to fix this rename the multiworld plugin to "aaaMultiWorld" and bukkit will load this plugin as first of all your plugin, this should also fix all other problems with other plugins
    Thanks to @Maxis010 for that

    How to create a gate:
    [torch][wood][torch] What you see to the left of here, is the framework of an gate
    [mossy][mossy] [mossy] The wood block left, is an sign with on the first line [detector],
    [mossy] -- [mossy] and on the second/third/fourth line should be the itemID's
    [mossy] -- [mossy] seperated by comma's.
    The script sees these lines as 1 line, so you should think its 1 line of 45 letters.

    How the #block (and future similair options) work:
    When you enter item id's on the 2nd/3th/4th line, it'll take those 3 lines and make it 1.
    If you enter the #block, the script will ignore that and make the gate blocking stuff.
    Here an quick example of what i mean (first is input, second is what script reads):
    What you write on sign --- What script reads for item ID's
    #block1,2,3,4,5,6,7     -   1,2,3,4,5,6,7
    1,2,3#block,4,5,6,7     -   1,2,3,4,5,6,7
    1,2,3,4,5,6,7#block     -   1,2,3,4,5,6,7
    List of current #options (open)

    @all - Makes the detector detect all blocks in mc
    @None - Makes the detector detect empty inventory's
    @hold - Makes the detector only detect your item in-hand
    @always - Makes the detector detect nothing, but instead always goes on whenever a player passes
    @limit - limits the blocks to these (you can't have any others then this)

    #block - blocks the entrace when activated
    #remove - removes the block from your inventory (Thinking about creating this to be OP-only)
    #pit - Creates a 3x3 pit for pitfall's
    #damage - Damages a player with 1 hearth
    #launch - Speeds up the player by 10x
    #kill - Kills the player
    #fire - Puts the player on fire
    #heal - Heals the player and puts out fire
    #repair - Repairs any tools which the gate detects
    #thunder - Makes thunder in the gate

    instead of using itemID's like in 1,2,3,4 (example), you can also use this:
    1-4 - Loads the ID 1-4
    kit:kitname - Loads the ID's provided in kitname.kit in the itemdetector directory

    To make the gate send a message, use the same method as kit, but use this instead:
    msg:filename - Sends a message provided in filename.message file in the itemdetector folder.

    Permission nodes (open)


    Video of it in action + how-to


    Show Spoiler

    Version 1.2:
    • Fixed new blocks with the gates from 1.7 (pistons, shears etc) and 1.6 (trapdoors etc)
    • Tweaked pitfall to stay 0.5 seconds longer (laggy servers can be bitchy)
    Version 1.1:
    • Fixed blocks changing (wood slab -> stone slab, red wool -> white wool, etc)
    • Fixed msg:filename when the gate rotation was wrong
    • Fixed launch from acting wierd sometimes
    Version 1.0:
    • Fixed permission bugs
    • Added support for 1-10 as itemID on the sign
    • Added support for personal kits (kit:filename) (look at the #options spoiler)
    • Added support for messages being send (msg:filename) (look at the #options spoiler)
    • Added support for configurable messages (not neceserry, but being able to)
    • made #block & #launch support minecarts
    • Fixed the anticheat perfectly now (no ignore node though anymore)
    Version 0.91:
    • Fixed #remove@always
    Version 0.9:

    • Tweaked anticheat
    • changed #limit into @limit (doesn't affect existing signs)
    • added @hold to just check the item in the hand
    • added @None to check for an empty inventory
    • added @always to make the gate always go on whenever a player passes
    • added #thunder to strike a thunder in the gate (itemdetector.create.thunder)
    • fixed the destroying of gates
    Version 0.81:

    • Fixed permissions
    Version 0.8:

    • Added an anticheat function, so you can't throw items through the gate, open chests or place blocks trough it. (itemdetector.ignore.anticheat)
    • #repair (
    • #heal (itemdetector.create.heal)
    • New permission nodes (so you can do itemdetector.create.* now
    Version 0.7:

    • Permissions support (if not found permissions, will default to OP's instead)
    • added #kill
    • added #fire
    Version 0.61:

    • Changed the #launch so it works.
    Version 0.6:

    • Added @all to indicate that you want to detect all blocks in minecraft
    • added #damage to give 1 hearth damage to the enterer
    • added a test version of #launch, to speed movenement by 10x for a short period (note this is glitchy atm, i'm working on a fix, but some people may like it now)
    Version 0.5:

    • Added #pit
    • Minecart support for any #option that isn't #block
    Version 0.42:

    • Fixed something really stupid of me (it didn't cancle the create if it failed)
    Version 0.41:

    • Fixed incompatiable #options
    • Sign given back now, if creating fails
    Version 0.4:

    • Added #limit + #remove, see post for description
    • Made support for armour contents
    Version 0.3:

    • Added #block to prevent players entering the gate
    • If a broken data file is found, it'll now try to fix as much as possible and load them.
    Version 0.2:

    • Fixed the redstone torch to stay for minimal 1 second.
    • Probably fixed a lot of similar bugs.
    Version 0.1:

    • Initial release
  2. so is the @always
    but yeah, that one was better for easyer debugging
  3. Offline


    Hi I found a bug.

    When I have wooden slabs in my inventory and i walk through a repair gate, my wooden slabs turn into stone slabs.
    Edit: Same goes for colored wool.

    I use CB766 and ItemDetector v1.0

  4. Thanks, will be fixed in 1,1

    also guys, consider updating to #793, it fixes the redstone bug in the first post
  5. Offline


    hmmz, I think im doing something wrong.
    I've tried to create a message detector, with the standard example.message, just to be sure it works.
    I created a framework and I put the following on a sign:

    And thats it, it creates the detector but when I walk through it, it wont show me the message.
    Any idea why this is?

    And thanks for fixing the above mentioned bug in 1.1 :D
  6. you did it with itemid 1 (smoothstone) in your inventory, right?
  7. Offline


    Yeah, I had over 200 in my invent sooo

    edit: I'm using rb766, and itemdetector 1.0 still
  8. @Dope any errors in the log? does the redstone go on? does the file "example.message" exists? (NOT "example.message.txt")
    if that still doesn't fix, is it a public server which i can see it on?
  9. Offline


    Nope, no errors in log, redstone does go on, and I use the example.message file that came with the addon pack.
    Ive also made a welcome.message file which also doesn't work.

    I'm hosting from my pc, I'll send you a pm with the IP.
  10. Offline


    It's possible to making gate works like that:
    Block if player haven't item in hand (Player can cross the gate only if they hold correct item)

    I'm sorry for my english. I hope that you can understand
  11. Offline


    @Kalumniatoris Yes this is possible.
    I tried this out for you with stone blocks. I entered the following on the sign:


    Change "1" into the item you want to use for the gate.
  12. Offline


    Really thanks
    I have an idea about something like labirynth, where I'll have used it.
    OK, there I'm sure that I make a mistake in this sentence.
  13. Rather


    else you'll detect it twice

    1.1 out!
    • Fixed blocks changing (wood slab -> stone slab, red wool -> white wool, etc)
    • Fixed msg:filename when the gate rotation was wrong
    • Fixed launch from acting wierd sometimes

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


    The detector can remove the object detected. But is it possible to give some object when we walk throught the detector?
  15. Nope, currently not
  16. Offline


    A nice feature would be to remove banned items on entering an area, and then giving them back upon leaving that area. Would be good for shops, arenas, safezones, etc.
  17. Offline


    This was requested before, ItemDetector is a dumb plugin, it does what it is told, how it is told to do it, it doesn't have the capability to store data beyond a list of detectors
  18. Offline


    It seems you've made it so that the gates prevents throwing items that it looks for within a radius.

    I have however found a workaround for this.

    If you pick an item that you want to keep (like some gold ingots), but the gate doesn't want you to.
    Say you have a stack of dirt, then you place one in each free square. Then you position yourself so you can throw your gold into the gate (that's as far as it allows). Then you fill the last free slot with some more dirt.
    Now when you walk up to the gate you wont pick up the gold simply because your inventory is full of dirt.
    And the gate can't take the gold because it's not in your inventory.
    When you've passed the gate you'll free up a slot and pick up the gold and you're home-free.

    This could potentially be solved by increasing the radius of the throw protection a bit. So you can't throw items into the gate. Then you would not be able to get them from the other side.
  19. Offline


    I like the plugin, and it fits perfectly for a setup I have in mind, but the issue I'm having is that any gates I make in a world other than the default do not make it through a server restart (though they do survive the restart command). The gates will show up in the data file just fine, but upon restarting the server they disappear from the file.
  20. Does anything appear in the console about corrupted data in the file?
  21. Offline


    I actually get a null pointer exception upon start up, though this never occurs on a reload. Opening the data file after this exception shows that all gates not made for the default world have been removed.

    21:57:50 [SEVERE] null loading ItemDetector v1.0 (Is it up to date?)
        at net.gamesketch.bukkit.itemdetector.Data.stringToData(
        at net.gamesketch.bukkit.itemdetector.Data.Load(
        at net.gamesketch.bukkit.itemdetector.core.onEnable(
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(
        at net.minecraft.server.MinecraftServer.e(
        at net.minecraft.server.MinecraftServer.a(
        at net.minecraft.server.MinecraftServer.init(
    Thought for a moment that I was using an out of date version, but it seems 1.1 still says 1.0
  22. This can easily happen if the name of your world has changed.
    what is the name of your default world? and is it loaded on startup? (I guess becouse default is always loaded)

    The error happens in "world.getBlockAt(x,y,z)" which means either the world is null, or the block where xyz should be is null

    oh and sorry about wrong version number, I forgot to update that I guess
  23. Offline


    could you make a # add feature that adds the blocks to your inv???
  24. Offline


    the default world is simply "world", and all gates in that world are unaffected. I have a world called Hardcore, and any gate made in that world is removed on a fresh start up.
  25. I guess that is becouse the world isn't loaded on startup, i'll try to get a workaround for this.
    That also explains why it survives a /reload, becouse the worlds are loaded already

    Small question, would you mind if I give you an debug version for that so I can actually see what exactly is wrong?
    I can run it local, but I don't got multiworld

    When you /stop your server, are the worlds still in the data file?
  26. Offline


    I'll have that info for you tonight, afraid I stepped out of town for the day and my remote access app has crashed :/

    I'd be happy to run the debug for you. Makes perfect sense that the worlds not being loaded yet would cause null pointers. As I said, I can't look at the console right now, but I am pretty sure ItemDetector is enabled before the worlds load.

    I don't have enough experience with plugin writing for bukkit yet to know, but is there a way to ensure one plugin loads after another?
  27. I thought the worlds from multiworld are being processed by bukkit, but i can be wrong with that
    Also I think it takes his plugin-loading ordering alphabetically
    so maybe if you rename the plugin to zItemDetector.jar, all others would load first.
  28. Offline


    Instead of renaming ItemDetector rename multiverse to aaamultiverse as this will fix ALL problems with multiverse loading after MV depended plugins, I have done that on my server and Streammz, every time you came along to do some testing you was in my world called "admin" so this is a proven success
    Streammz likes this.
  29. Offline


    adding some a's in multiverse's name worked perfectly, which makes me a happy plugin user.
    Streammz likes this.
  30. Offline


    I'm having an issue on my 803 CB server. I have successfully managed to create two properly working gates, but cannot get gates beyond them to work. I destroyed the first gate(which was #pit that dropped) and could not rebuild a new gate there(nor anywhere else). Rather, I'd build it(with same materials, dirt) and when I went to place the sign it gives me a "make a framework first" error. I've tried building it in several places out of several materials and I am continually getting this error.
  31. Offline


    Make sure there are no other blocks connected to the frame. just the frame, nothing else near it. Remove any blocks touching the frame.
    Then after building it you can put any blocks back against the frame.
    Also watch out with magic carpet. I once used magic carpet when trying to put the sign on top, and it gave me that error. The glass blocks from the carpet where touching the frame, letting it think the frame wasn't correct.

Share This Page