Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Simple Traps In Vanilla Minecraft (1.9)

Discussion in 'Minecraft' started by Nepeta Leijon, Sep 20, 2015.

Thread Status:
Not open for further replies.
  1. Nepeta Leijon

    Nepeta Leijon Rogue of Heart ♌ Leittarius

    Messages:
    3,917
    Likes Received:
    17,994
    Trophy Points:
    215
    Guild:
    Minecraft:
    After my creation of Vanilla C4 using Armour Stands with particle effects, I had wanted to make some kind of "Trap" mechanism with the mini-blocks. So I did, I'm not great at backstory. These were designed for Survival in Singleplayer and Multiplayer (though you'll need to change and add parts of the machine for each trap-user).

    Bounce:
    The Bounce trap resembles a Slime Block, and has an effect radius of 8. In order to place a bounce trap, you'll need to place a Slimeball in your off-hand slot (Default Key F) which will consume it, placing down a Bounce Trap. The Bounce trap will launch players and mobs near it high into the sky.
    2015-09-20_18.40.31.png
    2015-09-20_18.40.45.png
    Now you can make your dreams of being a Slime come true!
    Slow:
    The Slowness trap resembles a Soul Sand block, and has an effect radius of 8. In order to place a Slowness trap, you'll need to place a Clay Ball into your off hand slot. Doing so will consume the Clay Ball and place down a Slowness trap. The Slowness trap will slow mobs and players near it to a snails pace.
    2015-09-20_18.42.35.png 2015-09-20_18.42.52.png
    Warning: May make you feel like you've broken your legs.
    Blind:
    The Blindness trap resembles an obsidian block, and has an effect radius of 6. One of the more powerful traps, it can be created by placing a Nether Brick (from smelting Netherrack) in your off-hand. Any mobs or players caught in the trap will be blinded.
    2015-09-20_18.43.38.png 2015-09-20_18.43.48.png
    You can only see the HUD. It's not fun.
    Poison:
    The most powerful and expensive trap in the set, the poison trap resembles a Chorus Flower and has an effect radius of 6. it can be created by placing some Dragon's Breath in your off-hand slot. Any mob or player unlucky enough to get caught in this trap will suffer Wither 1 and Hunger 2.
    2015-09-20_18.44.14.png 2015-09-20_18.56.34.png
    The breath in that bottle is VERY powerful.
    Break Traps:
    Traps, once placed, cannot be broken by normal means. There is a way to destroy them though. For the cost of 16 Chorus Fruit, any traps within a 15 Block radius will be destroyed. In order to destroy traps, you'll need to place 16+ Chorus Fruit into your offhand, they're only consumed if a trap is destroyed.
    2015-09-20_18.56.51.png
    2015-09-20_18.57.16.png The reason it's chorus fruit, and costs 16 is for 2 reasons: 1. So traps become an "End Game" type item, and people on Multiplayer cannot easily destroy traps. 2. Chorus Fruit is quite abundant, so 1 would be too little.

    The "Machine":
    Important: Do not claim the command blocks' code or the "Machine" as your own, please give credit to me when using in areas such as Mini Games or Multiplayer Servers.
    I'm not the greatest at tutorials, nor at condensing an entire machine of command blocks into a single line of code, but here's a guide I typed up:

    Vanilla Traps Command Guide:


    Item Detection Machine:

    ITEM: Bounce: slime_ball Slow: clay_ball Blind: netherbrick Poison: dragon_breath

    /testfor @p {Inventory:[{Slot:-106b,id:"minecraft:ITEM"}]}
    Repeat,Active

    COMPARATORS TO:

    Sounds:

    SOUND and PITCH: Bounce: mob.slime.attack, 0 Slow: mob.spider.step, 1.4 Blind: mob.endermen.hit, 1.4 Poison: mob.enderdragon.growl, 1

    /execute @p ~ ~ ~ /playsound SOUND @p ~ ~ ~ 1 PITCH 1
    Impulse


    Trap Item Use:

    ITEM: Bounce: slime_ball Slow: clay_ball Blind: netherbrick Poison: dragon_breath

    /clear @p minecraft:ITEM -1 1
    Impulse


    Silverfish Summon:

    NAME: Bounce, Slow, Blind, Poison
    /execute @p ~ ~ ~ /summon Silverfish ~ ~ ~ {CustomName:NAME,Silent:1,NoAI:1}
    Impulse

    Silverfish Machine:
    NAME: Bounce, Slow, Blind, Poison
    /testfor @e[type=Silverfish,name=NAME]
    Repeat,Active

    COMPARATOR TO:

    NAME: Bounce, Slow, Blind, Poison
    /execute @e[type=Silverfish,name=NAME] ~ ~ ~ /summon ArmorStand ~ ~-1.3 ~ {NoBasePlate:1,NoGravity:1,Invisible:1,CustomName:NAME}
    Impulse
    COMPARATOR TO REPEATER TO:

    NAME: Bounce, Slow, Blind, Poison
    /kill @e[type=Silverfish,name=NAME]
    Impulse

    Effect Machine (Bounce and Slow):

    NAME: Bounce or Slow
    /testfor @e[type=ArmorStand,name=NAME]

    COMPARATORS TO:

    Bounce:
    /execute @e[type=ArmorStand,name=Bounce] ~ ~ ~ /effect @e[r=8] levitation 1 25 true
    Repeat

    execute @e[type=ArmorStand,name=Bounce] ~ ~ ~ /particle slime ~ ~1.5 ~ 2.5 0 2.5 0 5
    Repeat

    /replaceitem entity @e[type=ArmorStand,name=Bounce] slot.armor.head slime
    Repeat

    Slow:
    /execute @e[type=ArmorStand,name=Slow] ~ ~ ~ /effect @e[r=8] slowness 1 5 true
    Repeat

    execute @e[type=ArmorStand,name=Slow] ~ ~ ~ /particle cloud ~ ~1.5 ~ 2.5 0 2.5 0 5
    Repeat

    /replaceitem entity @e[type=ArmorStand,name=Slow] slot.armor.head soul_sand
    Repeat

    Effect Machine (Blind and Poison):
    NAME: Blind or Poison
    /testfor @e[type=ArmorStand,name=NAME]

    COMPARATORS TO:

    Blind:
    /execute @e[type=ArmorStand,name=Blind] ~ ~ ~ /effect @e[r=6] blindness 2 0 true
    Repeat

    /execute @e[type=ArmorStand,name=Blind] ~ ~ ~ /effect @e[r=6] night_vision 2 0 true
    Repeat

    execute @e[type=ArmorStand,name=Blind] ~ ~ ~ /particle mobSpell ~ ~1.5 ~ 2 0 2 0 5
    Repeat

    /replaceitem entity @e[type=ArmorStand,name=Blind] slot.armor.head obsidian
    Repeat

    Poison:
    /execute @e[type=ArmorStand,name=Poison] ~ ~ ~ /effect @e[r=6] hunger 1 1 true
    Repeat

    execute @e[type=ArmorStand,name=Poison] ~ ~ ~ /particle dragonbreath ~ ~1.5 ~ 2 0 2 0 5
    Repeat

    /replaceitem entity @e[type=ArmorStand,name=Poison] slot.armor.head chorus_flower
    Repeat

    WITHER EFFECT:
    /execute @e[type=ArmorStand,name=Poison] ~ ~ ~ /testfor @e[type=Player,r=6]
    Repeat

    COMPARATOR TO:
    /effect @p wither 1000000 0 true
    Impulse
    NOT GATE (Comparator,Repeater,Block with Redstone Torch Opposite Repeater, Command Block) TO:

    /effect @p wither 0 0
    Impulse

    Break Traps Machine:
    /testfor @p {Inventory:[{Slot:-106b,id:"minecraft:chorus_fruit"}]}
    Repeat,Active

    COMPARATORS TO:

    NAME: Bounce, Slow, Blind, Poison
    /execute @p ~ ~ ~ /kill @e[type=ArmorStand,name=NAME,r=15]

    POINTING TOWARDS CHAIN:
    /clear @p minecraft:chorus_fruit -1 16
    Chain,Conditional,Active
    POINTING TOWARDS CHAIN:
    /execute @p ~ ~ ~ /playsound random.break @p ~ ~ ~ 1 2 1
    The code can be customised to change the effects and looks, and (for multiplayer) add players to the list of people who can use the traps.

    In order to add a player, you'll need to change all "@p" to the name of the player. You'll then need to duplicate these (and their respective parts) and add a new name in place of your name. This method isn't great for larger servers, but can be used on private servers with small amounts of players.

    In order to change an effect, you'll need to edit this piece of code:
    /execute @e[type=ArmorStand,name=NAME*] ~ ~ ~ /effect @e[r=6**] EFFECT*** 1****1***** true******
    *This is the name of the armour stand, it's used to differentiate one armour stand to another
    **This is the radius that the effect will affect. This changes how far or close a player must be to the "Trap" to gain it's effects.
    ***This is the effect itself, changing this to "regeneration" for example, would give nearby players regeneration
    ****This is how long the effect will last. In this context, 1 means the effect will disappear as soon as a player leaves the area, 10 means that the player will have the effect for another 10 seconds after leaving, etc.
    *****This is the strength of the effect. Effects such as Speed will give faster speed the higher this is, while effects such as night vision will not be affected. If at 0, it will give the level 1 of the effect.
    ******This is whether or not to show the particles from the potion effect. If "True" then no particles will be shown (you can't tell what effect a player has) if "False" or not entered, then it will default to showing particles as normal.

    In order to change the looks of a trap, you'll need to edit these codes:
    execute @e[type=ArmorStand,name=Bounce] ~ ~ ~ /particle PARTICLE* ~ ~1.5 ~ 2.5** 0 2.5** 0 5***
    *This is the particle that will be shown, a list can be accessed by typing "/particle" and pressing Tab.
    **This is how far the particles will travel across the X and Z axis. The higher the number, the further they'll travel.
    ***This is the number of particles shown, the higher the number, the denser the particles will be.

    /replaceitem entity @e[type=ArmorStand,name=Poison] slot.armor.head ITEM*
    *Entering the name of an item here will change the look of the "Trap". Setting it to tnt for example, will make the trap look like a mini-block of TNT. In order to get the coded names of items, hold down F3 (FN/Cmd + F3 on Macs) and press H, and then mouse-over an item. A gray tag will display it's name at the bottom.
     
    Last edited: Sep 20, 2015
    Zahr and Wynslow like this.
  2. FAZu

    FAZu 6 digit ping guy CHAMPION

    Messages:
    313
    Likes Received:
    223
    Trophy Points:
    70
    Guild:
    Minecraft:
    ( ͡° ͜ʖ ͡°) Sound Dirty ( ͡° ͜ʖ ͡°)
     
Thread Status:
Not open for further replies.