• 0

    posted a message on /clear items with a specific enchantment

    /clear @p minecraft:diamond_sword 0 1 {ench:[{id:70,lvl:49}]}


    But you have to do it for every item.


    Yeah, I know you have to specify the item type, that's alright because a lot of the items are the same kind but with different abilities, enchantments and attributes. I'm using mending level 50, 49, 48, etc to distinguish between which item belongs to which team, so I can clear them if anyone gets an item from a different team. In case you were wondering.

    But anyway, thanks for your help.
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on /clear items with a specific enchantment
    Quote from theusafyoutube»

    Here is how:

    add a scoreboard:

    /scoreboard objectives add inSlot dummy


    run these commands in repeat:

    /scoreboard players set @a inSlot -1

    /scoreboard players set @a inSlot 0 {Inventory:[{Slot:0b,tag:{ench:[{id:70,lvl:49}]}}]} repeat thi step in multiple command blocks for the rest of the inventory slots..

    /execute @a[score_inSlot_min=0,score_inSlot=0] ~ ~ ~ /replaceitem entity @a[c=1] slot.inventory.0 air Repeat for all other slots.


    /clear supports data tags so that would be a waste of command blocks and server resources. I just need to know how to make the datatag work with /clear so that it targets items with mending level 49.
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on /clear items with a specific enchantment

    How would I go about clearing items from a player's inventory with a specific enchantment, in this case mending level 49? I would prefer to clear all items of any kind that have mending 49, however if it's only possible to do it with specific items that have mending 49 I can work with that as well. Thanks in advance.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on "The dataTag does not match..."
    Quote from theusafyoutube»



    You are almost correct. Just simply remove the 'b' from the '1' and it will work.. (Honestly I dont know why what happens) #StangeOnePointTenStuff?


    /scoreboard players tag @e[type=Item] add destroy {OnGround:1b,Item:{tag:{Unbreakable:1}}}

    The final command above is working, thanks a lot to both of you. Now I don't have to go kill my neighbor's cat.


    EDIT: For anyone who may lurk around this thread in the future, you can use the command below to remove the item instantly, rather than only after it hits the ground.


    /scoreboard players tag @e[type=Item] add destroy {Item:{tag:{Unbreakable:1}}}

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on "The dataTag does not match..."
    Quote from nigathan»

    No, using {Unbreakable:1} will not work as that is not a valid tag, also you are not specifying the type of data which is a byte. The tag I provided should work.


    Well, I tried your suggestion and it's not working. I also tried {Unbreakable:1b} and that doesn't work either.


    The following command works to clear the unbreakable elytra from anyone's inventory if they're in the wrong team, so I don't know what you're talking about when you say it's an invalid tag.


    /clear @a[team=!X] minecraft:elytra -1 -1 {Unbreakable:1}

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on "The dataTag does not match..."
    Quote from nigathan»

    The proper tag you are looking for is actually:


    {OnGround:1b,Item:{tag:{Unbreakable:1b}}}


    I tried that although I'm still getting the same error as before. But your suggestion is just slightly more specific. Both of them should work, should they not?
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on "The dataTag does not match..."

    On my server I'm setting up various scoreboard teams, each of which have their own specialty items which give them various abilities and such. Each specialty item can be distinguished by the unbreakable tag that each of them have. Since it's possible opposing teams could trade their specialty items and gain an unfair advantage, any player who has a specialty item in their inventory who is not apart of the correct team for that item will have it instantly removed from their inventory. That is working perfectly fine. However, I'm giving each team unrestricted access to get as many of these specialty items as they want, so I want to prevent them from spam dropping the items everywhere and lagging the server.


    In order to clear items from the ground I am trying to target them using the unbreakable tag that they all have but it's not working.


    TL;DR there are items on the server that have the {Unbreakable:1} tag and I'm trying to specifically target those items with the /kill command to remove them when they are dropped on the ground, but for some reason it isn't working.


    Here's are the contents of the two command blocks I'm using to remove said unbreakable items:

    1) /scoreboard players tag @e[type=Item] add destroy {Unbreakable:1}

    2) /kill @e[type=!Player,tag=destroy]


    The dropped items are not being removed and the command blocks are being spammed with the error "The dataTag does not match for [item UUID]"


    I've tried everything and it's still not working. Please help me so I'm not forced into a homicidal rage over Minecraft.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Detecting when two players have the same score in an objective (And targetting them)
    Quote from SoapSmoker200»

    So I got a way for it to work with entities with specific names but the problem is it will only work for entities not players and it needs a command block for every score number so if your score range is 0-10000 then you will need 10000 command blocks but I will post this here anyway since it may help you. Oh but I am still working on something so I will update you further...

    This is what I have right now to work with entites

    /execute @e[name=Test,score_random_min=1,score_random=1] ~ ~ ~ /execute @e[name=Test2,score_random_min=1,score_random=1] ~ ~ ~ /say hi


    I explained in my comment before that I am unable to make a command block to scan for every single number. Each player on my server has their own unique number, I can't set up a system of command blocks for every single player that joins the server. Thanks for your help anyway.
    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Detecting when two players have the same score in an objective (And targetting them)

    I'd like to make an update to say, it's not as simple as setting up two command blocks that are conditional with each of them testing for a player's score being a certain number because the numbers for each player will be different.


    Thanks again for anyone who will help me with this. Hopefully I'll get some replies soon.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Detecting when two players have the same score in an objective (And targetting them)

    I am trying to figure out how I can set up a system to detect when two players have the same score in a certain scoreboard objective on my server, and from there on I would do various things with those players like teleporting one of them to the other, giving them potion effects, etc. (This is for various things I'm setting up on my server)


    For example, if I wanted to detect when two players have the same score in the objective "teleport" and then teleport one player to the other, how would I accomplish this? Not only does it have to know that they both have the same score, but I also want it to target and teleport those exact players.


    I should also note that my server is 1.9 snapshot version 15w42a, so I have access to the new command blocks and some other new stuff if that helps.


    Thanks to everyone in advance for any help.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Testfor (Or other method) to test number of entities?

    Thanks everyone, I've managed to get the command figured out now. The only thing I'm questioning is if it's possible to set it up to track more than one object at once (Two entities or two blocks being tracked at the same time) since with the way it seems to work I'm wondering if it's even possible because I feel like the scores would get messed up, however I haven't really tried to test it out at all yet.


    Say I'm testing for cobble and emeralds at the same time, couldn't the cobble score cross over to the emerald score since they are both being updated? Or am I overthinking this?

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Testfor (Or other method) to test number of entities?
    Quote from Kishigai»

    The /stats command is what you're looking for. Let's say the maximum amount of boat allowed around a 64 blocks area is 16. Start with creating an objective:

    /scoreboard objectives add AntiLag dummy




    Then, on a clock in that order:

    scoreboard players add @a AntiLag 0
    
    stats entity @a set AffectedEntities @a[c=1] AntiLag
    
    execute @a ~ ~ ~ testfor @e[r=64,type=Boat]
    
    stats entity @a clear AffectedEntities
    
    execute @a[score_AntiLag_min=17] ~ ~ ~ kill @e[r=64,type=Boat,c=-1]




    Change the radius, the number allowed and the entity to your liking. If all regulated entities should apply to the same radius and number, you can start the clock with giving every regulated entity an AntiLag score then target by score instead of type, then add 'type=!Player'.


    Thanks! That's one of the few scoreboard commands I had never really used before, I feel like it must be fairly new as well. I think you actually killed two birds with one stone because I believe I'll be able to use that command to give all players an ascending score as they log in. Then I can use that to set up a tpa and tpahere system on my (vanilla) server. I should be able to do a home/sethome system using the numbers as well. The vanilla /spawnpoint command is limited to one location, and it requires you to teleport players through two end portals, which is currently not possible since the end is broken in the 1.9 snapshot.
    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Testfor (Or other method) to test number of entities?

    I'm trying to create an anti-lag system on my server (It's 1.9 snapshot, so I have access to repeat and chain command blocks) which will test for the amount of certain types of entities and remove them if they exceed the desired amount.


    -Example-


    A player is spamming boats all over the map. The anti-lag system is constantly using the /execute command to test for how many entities are within a certain radius around a player, and if it's higher than the amount I specify it will start killing them until the amount is back under the limit. This means if a player is trying to overload the server with boats, it will only remove the boats that specific player placed rather than every single boat on the entire server, which would be annoying for rule-abiding players.


    I know how to set everything up but I'm having trouble figuring out how it would be possible for me to count all of the entities in the easiest possible way. I feel like there should be a way to do this with /testfor since it seems like the kind of useful thing they would've added to the game, but no solution has come up yet.


    Again, what I'm looking to do is test for how many entities of a certain kind are loaded in the world. Preferably with the /testfor command, but any other solution is welcome too.


    Thanks in advance for any help!

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Please help me with High CPU usage
    Quote from Homichi»

    OMG MazeCraft!!! You'r amazing... i was going to try to make some funny wording with your name and amazing but I'm not that good lol..


    The fill clocks were using air, I switched them to stone and the cpu went from 100% down to 24% instantly.


    Thank you so much!


    Cheers!

    Homichi


    /gamerule logAdminCommands false


    Also make sure the "previous output" setting on all of the command blocks is disabled unless you are truly relying on it, which I doubt you are. When "previous output" is on, it causes the command blocks to constantly update over and over with the feedback for the command that was executed. Disabling it can help a lot. However, depending on what you are doing with your server and how many players you have, working with 1GB of RAM isn't all that great. So if anything adding more RAM would help.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Message upon joining?

    I have a 1.9 snapshot server and this is what I do. Keep in mind I have access to the new command blocks, repeat and chain.


    Run this command on a repeat: "/testfor @a[team=]"


    Set a chain command block connected to the repeat command block which is conditional, set the command in it to "/spawnpoint @a[team=] X Y Z" with the X Y Z being the coordinates that you want a player to respawn at.


    Add another conditional chain command block after that one and put this command in it "/scoreboard teams join [TeamName] @a[team=]" and this will end the cycle so the command block will stop setting the player's spawn point.




    This is how I do it on my server so new players respawn at spawn block on death, however I also allow players to change their respawn point, so instead of making it set their respawn point in a loop I have it set up that way so it only does it for new players. I don't suggest setting it up in a loop for all players over and over because /spawnpoint will overwrite player's bed location, as what it's essentially doing is forcing a bed respawn save point.


    There are other ways of testing for new players, such as creating a logout scoreboard objective and testing for a score of 0 and then setting it to 1, but that's the simplest way in my opinion.

    Posted in: Redstone Discussion and Mechanisms
  • To post a comment, please .