Inactive [ADMN] ChangeDat v1.4.1b - Change players inventory while they're offline (and online) [1337]

Discussion in 'Inactive/Unsupported Plugins' started by Sixael, Jul 10, 2011.

  1. Offline


    ChangeDat - Modify players inventory in-game while they're on- and offline
    Version 1.4.1b - Download in attachment (external below description)

    Well, another plugin I needed for my server and might be useful for anyone...
    Easy to use: just load the players inventory, change it, save it, done.

    This plugin allows ops and players with permissions to modify the inventory of offline players.
    <Edit by Moderator: Redacted mediafire url>

    /cdload <targetname>
    <font color="rgb(136, 136, 136)">-loads the inventory of the target.</font>
    /cdsave <targetname>
    <font color="rgb(136, 136, 136)">-saves the inventory of the target.</font>
    <font color="rgb(136, 136, 136)">-restores the users inventory after using cdload.</font>
    /cdscan <itemid>
    <font color="rgb(136, 136, 136)">-scans all player.dats for the item.</font>

    Permissions (default by OP):
    <font color="rgb(136, 136, 136)">-needed for cdload and cdrestore command.</font>
    <font color="rgb(136, 136, 136)">-needed for cdsave command.</font>
    <font color="rgb(136, 136, 136)">-needed for cdscan command.</font>

    For Programmers:
    If you wish to use this for your own plugin, there are currently two methods that can be used from outside:
    loadOfflineInventory(File file) and saveOfflineInventory(File file, ItemStack[][] inventory).
    The first method loads the Inventory by the players dat file, the parameter of course is this file. The method returns an ItemStack[][].
    ItemStack[0] = items (An ItemStack Array with 36 fields), ItemStack[1] = armor (An ItemStack Array with 4 fields).
    The second one saves the inventory, the first parameter is again a ItemStack[][], the structure of this object is the same as you get returned by the load method. The second parameter is the file you want to save the inventory in.

    Next releases:
    Change this plugin into a full ingame dat editor (this will take a lot of time).
    Automatic deletion of old dat files (if needed).
    Spout support.

    v1.4.1b: compiled with java 6 again.
    v1.4.1: fixed cdscan command, changed to PermissionsBukkit.
    v1.4: fixed loading items without damage data, can now be used as API.

    earlier builds:

    Show Spoiler
    v1.3: added support for online players.
    v1.2.5: added new permissions nodes.
    v1.2.4: removed world parameter.
    v1.2.3: removed messy code and stuff.
    v1.2.2: added case sensitivity again.
    v1.2.1: renamed command (cdclose is now cdrestore), added automatic restoring of the inventory when disconnecting or reloading the server, removed case sensitivity.
    v1.2: added new command (cdscan).
    v1.1: added new command (cdclose).
    v1.0: release.

    Attached Files:

    Last edited by a moderator: Nov 27, 2016
  2. Hmm, so you basically edit the player's inventory using your own inventory GUI ? nice.

    Still, you should also add /cdcancel or /cdclose to close without saving :}

    Aaaand... commands aren't verry descriptive, using plugin's name in the command is a bad ideea, use something like /invload, /invsave, /invclose
  3. Offline


    Without /cdsave the inventory won't be saved, so there is no need for a /cdcancel or /cdclose, but I'll add a command that gives you back your inventory without having to save. ;)
    Using the plugins name for commands is the easiest way to prevent conflicts, but I'll change the commands to /cdinvload and /cdinvsave (or something like that) if more people wish so.
  4. Offline


    You could make that an API, with a function like loadInventory(player) that would return a ItemStack[], and saveInventory(player, ItemStack[]). That would be useful for other plugins, that need to modify one player's inventory offline.
  5. Offline


    Didn't test yet but can you edit the inventory of an ONLINE player as well with this?
    Clearing somebody's inventory with /clearinventory <name> is rarely needed on our server, mostly it's just taking out 1 item :)
  6. Offline


    crahed client when invatoy got opened
    it was a bad invatory :/
    works NICELY! but i will say it suckes that u need XEACT spelling and CAPS do count
    maby u should add that CAPS count in ur op
    also this workd with 1.6.6 and its ITEMCRAFT complient
  7. That was actually my point, to close without saving.

    That would also be nice, but it'll require a different approach, this plugin basically edits .dat files from worldname/players/, editing live players should be easier.

    EDIT: I see that you can load your own inventory but you can't save it because you're online =)
  8. Offline


    To make this an API is a good idea, but first I want to check for bugs and add more stuff. ;)

    Nope, this is only for offline players. ;)

    Won't work since filenames are case sensitive, Woodzy != woodzy.

    Oh, sorry for mistaking. :/
  9. Hmm, I also tested disconnecting while having an inventory loaded, it kinda saves the inventory you have and your original inventory gets lost, you should restore it on disconnect :p

    Well that's not really true, I just re-logged using "digi" instead of "Digi" and it gave my inventory and stuff, the game doesn't care about case sensitivity, and 'nor should you :p convert all names to lower case and work with that.
    Still, I'm on windows, I dunno for linux.
  10. Offline


    Depends on the OS the server is running on, actually.

    That said, it's a nice complement to OpenInv, which allows for editing of online player inventories.

    My request to you, would be if you could create a search inventory command, so that inventories could be quickly scanned for particular items.
  11. Offline


    Sounds good, I'll make it so the user gets a list of "owners".

    Edit: Scanner added.

    Both changed. ;)
  12. Offline


    Open source? :D
  13. Offline


    Not yet, but as mentioned earlier it might be used as API soon. ;)
  14. Offline


    V1.2.2 out, case sensitivity is back in since it's needed on some systems.
  15. Offline


    Not to be a bother, but another request if I may.

    If no world is specified, it will default to the world the command was issued on?
  16. Offline


    Of course you can put requests in here, I'm happy about every good idea. ;)
    Sooo... new version is up, no more world parameter needed. :p
    I'm thinking about adding proper multiworld inventory support, so every world uses the original players dat file (or I'll make an extra plugin for this), next version will most likely be able to change online players inventory.
  17. Offline


    Could you add proper permission nodes? Like:
    • changedat.scan
    • changedat.load
    I want my mods to be able to look but not edit, hence not giving them the save command.

    Also how does this work with the MultiInv plugin? Will there be any issues with that?
  18. Offline


    Added but not tested, since I don't use permissions. ;)
    Won't work with MultiInv plugin since it doesn't use the official file format.

    Working in 1.3, when the player logs off while you're editing it's saved to his file.

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


    I like your idea, but I'm trying to implement this in my Openinv, and well, I'm trying to make it full auto, without commands, just a gui (minecraft inventory gui). If you can open the source to me, it would be great :D

    Openinv :D

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


    I never release a source before I quit working on stuff, but I'm currently changing the code so you can simply import it to your project and use the load and save methods. It'll be finished by tomorrow at the latest. ;)
  21. Offline


    Could you add:
    Give EVERYONE (offline too) a item or delete by EVERYONE a item :)
  22. Offline


    Good idea, like /cdgive itemid amount and /cdremove itemid amount?
    What should happen if there's no free slot?
  23. Offline


    Oh .. if no slot hmm .. delete items with low priority like dirt?
  24. Offline


    Hmm, priority is individual from player to player, I'll add the remove command first, so I have some time to think about the give command.
  25. Offline


    Maybe he wait when the player comes online and the plugin wait until the user have a free slot in the inventory and give then the item.
  26. Offline


    Hmm, that would go off to far from the initial idea. ;)
  27. Offline


    Bug report: it doesn't show block data. I.e. it shows all wool as white wool
  28. Offline


    k, fixed that, new version will be up in about half an hour.

    Edit: new version upload will delay for a bit, I'm adding the ability to use the offline load and save function from outside (API stuff).

    1.4 is out, I hope the "for programmers" part is written understandable.

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


    Sad to say we have noticed a bug, and even sadder to say I can only report what it does, there is no stacktrace in the console.

    Simply, loading an inventory will occasionally wipe out one's own; /cdrestore does nothing.

    Mind, this is version 1.3, I will check to see if it still exists in 1.4, but I thought I should let you know.

Share This Page