• 0

    posted a message on Scoreboard question.

    Hold that thought! I did a little bit of research and it turns out there are other ways other than scoreboards.

    A villagers trade has a "uses" tag which counts well... uses.

    I've never used this so you will have to experiment with it.

    You can view the data structure here: https://minecraft.gamepedia.com/Villager#Data_values under "Data values"

    Using this tag, you can detect which trades the player used and how many times he used them.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need Help Making Custom potion survival friendly with command blocks
    Quote from damen235»

    I think i will use functions when i have all the commands i want to be figured out, im thinking 3 of an ingredient will do for one drink, i didn't know that i couldn't use 0,5 as a value on custom potions so, im trying to figure out how not to make this equal or better than potions, so far i just got most of my alcohol with effects set to 1 for 90 sec, also i think i want hunger and Nausea when you excide 3 of any of my custom potions instead of just Nausea, im trying to look for a way for a container block to be tested for the ingredient item, then remove sed ingredient item to get specific custom potions, idk how long i was thinking Nausea and hunger to last, maby 5 min

    so for i got 6 drinks, Wine, Beer,Tequila, Rum, Vodka, and Cider, i have them all with the effects name and colors i want so far


    one issue you will encounter on the way is: if you clear the barrel inventory to put the drink in it, any item the player puts in the barrel will also get deleted. To prevent this, you will have to detect each slot of the barrel to make sure only ingredients are there and no other items. Another way is to populate the barrel inventory with some placeholder items and leave only 3 slots empty. This way, the player can only insert 3 items.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard question.
    Quote from Mambanator09»

    'bought' is just a dummy objective



    but there is no way to tell if the player bought something or not and increase the "bought" objective (not sure tough)

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command problems

    ops, how did I not notice that??

    thanks for pointing out the mistakes, here is the corrected one:

    summon minecraft:falling_block ~ ~2 ~ {BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-15 ~5 ~-20 ~-15 ~1 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-14 ~ ~-20 ~-13 ~ ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-11 ~-1 ~-20 ~-9 ~3 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-11 ~-1 ~-20 ~-10 ~-1 ~-20 air"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-10 ~1 ~-20 ~-7 ~-3 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-7 ~1 ~-20 ~-7 ~-4 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/summon falling_block ~2 ~ ~ {BlockState:{Name:\"command_block\"},Time:1,TileEntityData:{Command:\"fill ~-9 ~2 ~-20 ~-19 ~6 ~-20 air\"}}"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-6 ~-4 ~-20 ~-5 ~-4 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~1 ~-6 ~ ~1 ~ ~ redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"redstone_block"},Time:1}]}]}]}]}]}]}]}]}]}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard question.

    There's no "bought" objective or anything similar so... not sure how that will work.

    Another issue is that you can't detect what item the player bought (I think)

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need Help Making Custom potion survival friendly with command blocks

    you can use this to place the potion in the barrel:

    /execute if block <x> <y> <z> barrel{Items:[{id:"minecraft:sweet_barries,Count:1b"}]} run data merge block <x> <y> <z> {Items:[{id:"minecraft:potion",Potion:{...}}]}

    for the Potion:{...} you can use an online potion generator

    To keep track of the players drinking:

    /scoreboard objectives add drink minecraft.used:minecraft.potion

    this will increment by 1 every time a player drinks a potion

    you can now do:

    /effect give @a[scores={drink=3..}] minecraft:nausea 10 0 true

    and reset the score

    /scoreboard players reset @a[scores={drick=3..}] drink
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard question.

    Just use the built-in scoreboard criteria to detect when a player right clicks a villager

    /scoreboard objectives add clickedShop minecraft.custom:minecraft.talked_to_villager
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command problems
    Quote from o_markica»

    Hey

    I have been having problems because of this command not working. Can someone please help?

    /summon falling_block ~ ~1 ~ {Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-15 ~5 ~-20 ~-15 ~1 ~-20 redstone_block"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-14 ~ ~-20 ~-13 ~ ~-20 redstone_block"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-11 ~-1 ~-20 ~-9 ~3 ~-20 redstone_block"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-10 ~1 ~-20 ~-10 ~-1 ~-20 air"}, Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-7 ~1 ~-20 ~-7 ~-3 ~-20 redstone_block"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-6 ~-4 ~-20 ~-5 ~-4 ~-20 redstone_block"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/summon falling_block ~2 ~ ~ {Block:command_block,Time:1,TileEntityData:{Command:"/fill ~-9 ~2 ~-20 ~-19 ~6 ~-20 air "},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"/fill ~1 ~-6 ~ ~1 ~ ~ redstone_block"},Passengers:[{id:falling_block,Block:redstone_block,Time:1}]}]}]}]}]}]}]}]


    Here you go:

    summon minecraft:falling_block ~ ~2 ~ {BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-15 ~5 ~-20 ~-15 ~1 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-14 ~ ~-20 ~-13 ~ ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-11 ~-1 ~-20 ~-9 ~3 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-11 ~-1 ~-20 ~-10 ~-1 ~-20 air"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-10 ~1 ~-20 ~-7 ~-3 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-7 ~1 ~-20 ~-7 ~-4 ~-20 redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/summon falling_block ~2 ~ ~ {BlockState:{Name:\"command_block\"},Time:1,TileEntityData:{Command:\"fill ~-9 ~2 ~-20 ~-19 ~6 ~-20 air\"}}"},Passengers:[{id:"command_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~-6 ~-4 ~-20 ~-5 ~-4 ~-20 redstone_block"},Passengers:[{id:"command_block",BlockState:{Name:"command_block"},Time:1,TileEntityData:{Command:"/fill ~1 ~-6 ~ ~1 ~ ~ redstone_block"},Passengers:[{id:"falling_block",BlockState:{Name:"redstone_block"},Time:1}]}]}]}]}]}]}]}]}]}

    • Block:"" is now BlockState:{Name:""}
    • " quotes have to be formatted when inside another pair of quotes with \"
    • the Passengers tag of the command block summoned from another command block was in the wrong section

    This works but it only spawns 7 command blocks while the code is supposed to spawn around 9. This is something you will have to take a look at.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to kill an amount of entities with a certain tag.

    Hey, so I'm creating a thing to lag players (don't ask) by summoning invisible armour stands with a tag but its very quickly gets up to mote than 2000 which is almost enough to crash minecraft. How would I go about killing off armour stands if say there's more than 500 so there's always roughly 500 existing armour stands at any given time until I turn off the clock,

    Thanks!


    you can run this a couple of times to spread the load or just remove the limit and remove them all at once

    /kill @e[type=armor_stand,tag=...,limit=100]
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on ok sorry but basically your gonna help me build a awesome mini game.
    Quote from Daiginn»

    That just set them to zero


    i wonder if i can do something like


    execute @a[r=(within)25,] scoreboard objectives setsisplay arenamob

    but it didnt like “scoreboard” there ill look back again im sure i typed it wrong.


    and hmm i cant do another that is r=(greater than)25 scoreboard... cause i have multiple arenas and they would be affected adversly by that....


    within and greater than are supported in Java 1.13 but not in Bedrock. The reason it doesn't like "scoreboard" is because you need to specify the offset after the "execute" so it would look like this "execute @e[...] ~ ~ ~ scoreboard ..."

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on ok sorry but basically your gonna help me build a awesome mini game.
    Quote from Daiginn»

    How do i remove one player from the leaderboard?


    try resetting the player's score

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How can you execute a command at an entity lower than a certain height?
    Quote from mun8mun»

    How can you execute a command at an entity lower than a certain height?
    And is there an easy way to make an item levitate?
    I want to make items that drop to a ceratin height levitate upwards until a certain height and then start kind of staying there
    Using command blocks

    Thanks


    EDIT: Completely forgot the important part - my MC version 1.13




    Create a scoreboard objective:

    /scoreboard objectives add y dummy



    store the y coordinate of the entity into the "y" objective (this command must run in a repeating command block):

    /execute as <entity> run execute store result score @s y run data get entity @s Pos[1]



    test the value of "y" to see if it is below a certain value and execute a command:

    /execute as @e[scores={y=..64}] at @s run ...



    change 64 to the desired height level.

    I don't think you can make items levitate.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to get player input and use it?
    Quote from Mambanator09»

    Alright and how do I display a characters gamertag on an armor stand or is there a way to make gamertags visible when players are invisible?


    I don't think there is a way to display the nametag of an invisible player.

    You can't display a player's name on an armor stand either because the "CustomName" tag doesn't support selectors.

    This is something that I would like to see Mojang add into the game.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to get player input and use it?
    Quote from Mambanator09»

    Nice. Can I do this with the title command so that I can display it on the action bar?


    yes

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to get player input and use it?
    Quote from Mambanator09»

    Read my edited post


    that makes sense, I think the command I wrote will do the trick

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.