home Forumsplay_arrow Minecraft fiber_manual_record Redstone

1

Problem with Scoreboard stat.drop

1 emerald3 replies75 views
created 05/19/2018 4:10 pm by Evolutiounxx
last reply 05/20/2018 1:06 pm
Hello dear redstone enthusiasts!

Recently I´ve started working with scoreboards.
I am making a contraption that, after detecting more items then what should be dropped, it cleans the ground.
But my problem is creating the criteria, for example, I want that specific item to be redstone lamps, so theoretical, the command would be: "/scoreboard objectives add tete stat.drop.minecraft.redstone_lamp", but It does not work as it shows in this print I´ve taken (http://prntscr.com/jk0xhp). I started then to experiment other stuff, like going to survival (the same problem), going to other servers (the same thing also), tried changing the criteria to be like stat.drop.1, but nothing worked...

I would like to know what could be the problem if possible...

Have a nice day!
Posted by avatar
Evolutiounxx
Level 1 : New Miner
0

3 replies

1
05/20/2018 7:19 am
Level 1 New Miner
Evolutiounxx
avatar
Hello!
Thanks for the explanation...
The only problem is that my server is on 1.8 so the area effect cloud does not work.

Still looking for solutiouns (while I try some on my own)...
1
05/20/2018 1:06 pm
Level 2 Apprentice Engineer
SUPERIONtheKnight
avatar
Ah, ok. Well Here's an answer for 1.8. It's actually almost the same as before. :)

Chat Commands
/scoreboard objectives add test dummy
/scoreboard objectives add ID dummy
/summon ArmorStand ~ ~ ~ {Invisible:1b,Marker:1b,NoGravity:1b}
/scoreboard players set @e[type=ArmorStand,r=5,c=1] ID 1

Use the following Clock commands if you want to detect/remove any item.
scoreboard players reset * test
execute @e[type=Item] ~ ~ ~ scoreboard players add @e[score_ID_min=1,score_ID=1] test 1
execute @e[score_ID_min=1,score_ID=1,score_test_min=10] ~ ~ ~ kill @e[type=Item]

Use the following Clock Commands if you only want to detect/remove redstone lamps.
scoreboard players reset * test
scoreboard players set @e[type=Item] test 1 {Item:{id:"minecraft:redstone_lamp"}}
execute @e[type=Item,score_test_min=1,score_test=1] ~ ~ ~ scoreboard players add @e[score_ID_min=1,score_ID=1] test 1
execute @e[score_ID_min=1,score_ID=1,score_test_min=10] ~ ~ ~ kill @e[type=Item,score_test_min=1,score_test=1]

Hopefully that works this time! :)
~SUPERIONtheKnight
1
05/20/2018 1:24 am
Level 2 Apprentice Engineer
SUPERIONtheKnight
avatar
So from what I understand, you want to clean the ground after detecting a certain number of items?

If so, I don't recommend using stat.drop.minecraft."item_name" because it would probably give inaccurate results in this scenario. This is because it detects how many items were dropped and not how many items are actually in the world.

To explain, lets say that we want to detect when there are 50 items on the ground. Well it works fine, we detect that I dropped 50 items on the ground and it removes them. However if I dropped them one at a time while also picking them back up, this is still going to add to the score. This means that if you kept going and stopped when the score is at 49, some other poor soul has the risk of losing their dragon egg by simply dropping it alone.

To get around this, I recommend using dummy instead so that we can do this manually.

Chat Commands
/scoreboard objectives add test dummy
/summon area_effect_cloud ~ ~ ~ {Duration:2147483647,Tags:["checkItems"]}
Clock Commands
scoreboard players set @e[tag=checkItems] test 0
execute @e[type=item] ~ ~ ~ scoreboard players add @e[tag=checkItems] test 1
execute @e[tag=checkItems,score_test_min=10] ~ ~ ~ kill @e[type=item]
That will remove any items in the world if there are 10 or more items.
Now if that is all you want, that should be good enough. However if you really only want to detect the redstone lamp, you will have to add two extra "scoreboard players tag" commands as /execute can't read nbt in 1.12.2 or lower.

Clock Commands
scoreboard players tag @e[tag=lamp] remove lamp
scoreboard players tag @e[type=item] add lamp {Item:{id:"minecraft:redstone_lamp"}}
scoreboard players set @e[tag=checkItems] test 0
execute @e[type=item,tag=lamp] ~ ~ ~ scoreboard players add @e[tag=checkItems] test 1
execute @e[tag=checkItems,score_test_min=10] ~ ~ ~ kill @e[type=item,tag=lamp]
I hope this helps!
~SUPERIONtheKnight

Search

Browse

Site

© 2010 - 2018
planetminecraft.com

Welcome