• 0

    posted a message on A way to lock chests in Vanilla SMP 1.8
    I'm working on a simple Java Agent that modifies the minecraft 1.8 server classes on the run, allowing a sensible use of the {Lock:""} data tag in SMP.

    This data tag makes any block that holds items, a locked container that can only be opened by holding an item named exactly like the lock.

    Making a "key" is as simple as naming an item in an anvil, the problem is applying the lock on the container, which can only be done with commands.

    The first thing the mod does is allowing to "lock" a container by using the "key" item on the block while sneaking. The same action will "unlock" a container if done with the corresponding key.

    Next, the mod protects all locked containers from being mined by players or broken by explosions. It also prevents hoppers from extracting items, unless both the container and the hopper have the same lock.

    Last, it hides the data tag holding the name of an item when sending packets to the players, preventing the use of modified minecraft clients (cheaters) from finding out the string used to lock the containers. Also, on player death, only the original owner will be able to pickup dropped items that have been named (and, as a side effect, those items will not despawn), although they can still be destroyed if they fall on lava, fire, etc.

    Right now the "mod" is composed by only one java file:

    https://gist.github.com/anonymous/6d31635dc259b326b3bd

    It uses the javassist library to alter the minecraft classes bytecode:

    http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/

    The compiled class has to be packed in a jar with a java agent manifest file:

    Manifest-Version: 1.0
    Premain-Class: mod.LockableChests
    Boot-Class-Path: javassist.jar

    And it's loaded by adding the -javaagent parameter when running the minecraft server jar:

    java -javaagent:lockable-chests.jar -jar minecraft_server.jar


    I'll try to provide later a compiled jar file for testing.
    Posted in: WIP Mods
  • 1

    posted a message on Minecraft BINGO - Vanilla Survival Scavenger Hunt!
    I wanted to leave this mini-game running on an unattended server, so I made a few changes. The following "patch" can be run on the server console to modify version 2.2:

    https://gist.github.com/anonymous/af4a43be82126542e29e

    A short list of the changes made:

    * Instead of showing the score for each player it shows the score for Red and Blue

    * Players can join a running game by stepping the appropiate pressure plate

    * White team is replaced with spectator mode

    * Players who disconnect are reset and respawned in the staging area next time they connect

    * The reset button is removed and the game auto resets when there are no more players in game

    * The game is always run in two teams mode
    Posted in: Maps
  • To post a comment, please .