• 0

    posted a message on need some help

    It looks like there was a syntax error. If that is from your data pack, it may be because you used spaces somewhere you shouldn't have. Perhaps you could replace those invalid spaces with underscores? If that doesn't work, make sure you have your tag for the entity whatever tag you specified in the generator. I noticed you used the pig, which has a tag of "MyNPC". That may not be what you want.


    If it worked once, likely you had the "distance reset" checkbox off. Turn this checkbox on, and the NPC will talk to you again after you come out and go back into range of the NPC. If it was unchecked, you must run the cleanup function and then setup function again, then it should start working again. I believe this is separate for each player, so another player may be able to chat with the NPC even if you aren't.


    If you continue having problems, you could probably contact them at [email protected]


    You can add the players' username into a tellraw command using the JSON "{"selector":"@p"}", but I strongly suggest you use some kind of command generator instead of attempting to do it yourself. Tellraw commands are easy to mess up and hard to debug. Mcstacker can generate one for you, other good sites for it are https://minecraftjson.com/ and http://minecraft.tools/en/tellraw.php

    Posted in: Redstone Discussion and Mechanisms
  • 1

    posted a message on Remove a tag from everyone who doesn't have an item in the right slot

    /execute as @a unless entity @s[nbt={Inventory:[{id:"minecraft:dragon_egg",Slot:17b}]}] run tag @s remove kek


    The "unless" feature in /execute is particularly useful in this situation.

    Posted in: Commands, Command Blocks and Functions
  • 2

    posted a message on What's the simplest way to make a time and space dependent hint system with command blocks?

    Checking for a rectangular room is very hard, but you could check if the player is in a circular range very easily.


    I would suggest that in each room you use the following command (do not copy after "//"):


    /scoreboard players set @a[distance=..(your_range_here)] room (room_number_here) //Should run every tick.


    This will make sure that players in different rooms have different scores.


    Then, write a command chain like this (do not copy after "//"):


    /execute as @a unless score @s room = @s lastRoom run scoreboard players set @s timer 0 //Will reset the timer when a player changes rooms. Should run every tick.

    /execute as @a run scoreboard players operation @s lastRoom = @s room //Will update lastRoom. Should run after the last command unconditionally.

    /scoreboard players add @a timer 1 //Will update timer. This can run separately from the last two but should run every tick unconditionally.


    After that, put in every room a command chain like this:


    /tellraw @a[distance=..(your_range_here),scores={timer=(hint_time)}] "your_message_here" //Will give a hint to anyone in the room for (hint_time) ticks. There are 20 ticks in a second. Should run every tick.


    You can do this as many times as you want, just add to your hint command block chain.


    You will need to create scores "room", "lastRoom", and "timer"


    NOTE: This has been tested and works in 1.13


    Here's a video with the commands:

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on stock market

    You could simply repeat the adding command 5 times. If you need this to be versatile, create a new score called "temp" and one called "multiplier" (or whatever you want). "temp" is a temporary value used for calculations, and "multiplier" is the amount you want to multiply by. You could run the following commands:


    /scoreboard players set player1 multiplier 5

    /scoreboard players operation player1 temp = player1 TaRo

    /scoreboard players operation player1 temp *= player1 multiplier

    /scoreboard players operation player1 currency += player1 temp


    An explanation of the steps:

    1. set the multiplier to 5. This can be seen as a parameter for the operation.
    2. transfer the value of "TaRo" to "temp". This is done so that we do not have to multiply the value of "TaRo" directly. If you were to multiply the value directly, you would need to divide it by 5 at the end of the chain in order to restore the previous value.
    3. multiply "temp" by the multiplier, which should make "temp" the equivalent of "TaRo * 5"
    4. add "temp" to "currency" to complete the operation.

    Minecraft does not parse raw mathematical expressions.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [1.13] Player detection using execute

    Apparently, NBT will only work correctly if the block is a special block such as a furnace, brewing stand, or chest. I would suggest you go with the other solution.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on need some help

    Try this: https://mcstacker.net/npc/


    It is a well-known command generator that can allow you to add custom dialogue and action to your entities.


    To get a description of a property, click the question mark button, and you will get a description.


    It works through a data pack, which you can embed into your world file.


    You will need to Summon each separate armor stand with a specific tag. Armor stands with the same tag should do the same thing.


    There is a tutorial on the page. If you are using Minecraft Realms, the installation of a data pack works differently. You must download the world, open it to LAN, install the data pack, run the command "/reload", and then upload the world back onto Realms.



    You can generate complex commands at mcstacker.net these commands should be used in a command block.


    You can use it to summon any entity with any property available in Minecraft. It also has descriptions of each property via the question mark button.


    It may be useful to create a spawn egg for a specific armor stand with specific tags. If you would like to do this, do not use the give spawn egg command, but the give armor stand command. The spawn egg will not summon armor stands correctly.

    Quote from heyo13579»

    /tellraw @p ["",{"text":"text\n","color":"red","bold":true,"underlined":true},{"text":"option 1\n","clickEvent":{"action":"run_command","value":"setblock cmd"},"color":"none","bold":false,"underlined":false},{"text":"option 2","clickEvent":{"action":"run_command","value":"<setblock cmd>"},"color":"none"}]


    all you do is just keep adding more text and editing the text i recomend using the click events to trigger setblock commands that sets a block of redstone to trigger a command block depending on the option that way each command block will be fore one option and you dont have to worry about the head ache of nested commands



    I don't believe a click event will allow you to run multiple commands on one event, and I think it is limited by permissions.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on [1.13] Player detection using execute

    Here is a better solution that saves command blocks, but requires you to change the nbt of the blocks you place:


    /execute as @a if block ~ ~-1 ~ your_block{your_tag:1b} run tp @p -161 58 -137


    "your_block" is the type of block the pressure plate is.

    "your_tag" is a tag specifying whether to have the block act as a pressure plate.


    To add the nbt to the block you can either use "/data merge block <x> <y> <z> {your_tag:1b}" or you could place the block with the nbt already in it using the resulting item from this command: "/give @p your_block{your_tag:1b} 1"

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command block "execute as" command not working properly

    The "as" modifier only changes the executor. The "at" modifier will change the actual position. The "@p" selector works off of the position, not the executor. It makes perfect sense for the command not to work without "at @s".


    I'm quite confused about why you want to do this in the first place. Wouldn't it be easier just to put a command block behind the button?

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on stock market

    Yes. You can use:


    scoreboard players operation player1 currency += player1 TaRo


    You can also do -=, /=, %=, *=, and a few others.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need redstone help!!! ;3;

    You can generate complex commands at mcstacker.net these commands should be used in a command block.


    You can use it to summon any entity with any property available in Minecraft. It also has descriptions of each property via the question mark button.


    It may be useful to create a spawn egg for a specific armor stand with specific tags. If you would like to do this, do not use the give spawn egg command, but the give armor stand command. The spawn egg will not summon armor stands correctly.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Need redstone help!!! ;3;

    Try this: https://mcstacker.net/npc/


    It is a well known command generator that can allow you to add custom dialogue and action to your entities.


    To get a description of a property, click the question mark button, and you will get a description.


    It works through a data pack, which you can embed into your world file.


    You will need to Summon each separate armor stand with a specific tag. Armor stands with the same tag should do the same thing.


    There is a tutorial on the page.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Get the position of a specific block.

    Are you asking to store the position somewhere or to execute a command at that position?


    If you are asking to store the position, your solution depends on where you want to store it. You could use the execute store command to score the positions onto the nbt of any entity or block.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Need redstone help!!! ;3;

    You can also compress your entire chain into one block, given that it consists of a condition and an action. You can append "run <command>" to the end of an execute command, and the new command will only run if the condition succeeds. In this case, your command chain could be compressed to:


    execute if entity @p[distance=..3] run say j


    You can also edit the entity executor using the modifier "as <entity>". You can edit the position to execute the command at using "positioned <x> <y> <z>" or "at <entity>". You can also manipulate the command in many other ways. All of this should be documented in Minecraft itself through command auto-complete.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Need redstone help!!! ;3;

    You can also use this to define number ranges. For example "2..3" means "in between 2 and 3", and it is inclusive on both sides.


    A range such as "y..x" would mean "in between y and x", instead of "y is greater than x". You are defining a number range, not a condition.


    Technically, if you didn't specify a number on both sides, Minecraft would assume the highest or lowest number possible. If we represent the maximum number with "infinity", "..3" would be equal to "-infinity..3" and "3.." would be equal to "3..infinity". Minecraft allows you to omit one side of the range for convenience.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Need redstone help!!! ;3;

    You need to use "execute if entity @p[distance=..3]". The key is the "..". Without that, the command will only execute if there is a player that is exactly 3 blocks away, which is virtually impossible. The ".." before the "3" means "less than or equal to", which should fix your problem. If you use, ".." after the "3", it will mean "greater than or equal to".


    If you look at the timestamp of the command, you will see that the command did in fact run within a minute of when you took the screenshot, so your redstone mechanism did activate the block. For this reason, I don't think anything is wrong with your redstone.


    I would suggest to you that instead of using a comparator to send the signal, move that impulse command block so that the repeating command block is facing it. Then, change the impulse command block to a chain conditional always active command block.


    This will create a command block chain so that the second block will run directly after the first block does. Because it is conditional, the second block will only run if the first block succeeded. This solution is easier, more scalable, and has better performance than a comparator. It is also more organized.


    If you wanted the second block to run after the repeating block every tick whether the first one succeeded or not, you would just need to remove the conditional property. If you wanted another command block to run after the second one, you would simply need to extend the chain by placing another chain always active command block that the second command block is facing towards. This can go on as long as you want.

    Posted in: Redstone Discussion and Mechanisms
  • To post a comment, please or register a new account.