• 0

    posted a message on i want to make a flying pig hold a diamond sword

    One thing that could get the sword closer to where you want is to put both the pig and the armorstand in the bat's passenger tag. Instead of stacking them on top of each other, you'll be putting them on the same layer.


    /summon minecraft:bat ~ ~1 ~ {ActiveEffects:[{Id:14,Amplifier:0,Duration:20000000,ShowParticles:0b}],Passengers:[{id:"minecraft:pig"},{id:"minecraft:armor_stand",Invisible:1,Pose:{RightArm:[0f,0f,0f]},HandItems:[{id:"minecraft:diamond_sword",Count:1b},{}]}]}

    You may be able to get the sword closer to the pig's "hand" by making the armorstand small and adjusting the pose of the armor stand's right arm.

    If that's still not enough fidelity for your taste, another option would be to use a repeating teleport command instead of the passengers tag. Let me know if this is the route you want to take. Just keep in mind that even with this method it's not going to sync up with the pig's "hand" 100% of the time.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to make sever wide message with command block?

    Unless your server is something special, what you want is probably as simple as a /tellraw (or /say for the most basic possible version).


    /tellraw @a "Wow, A message in the Chat"

    If you learn how to use JSON text formatting or us an online tool, you can format the text in nifty ways as well as add things like click events and player names.


    /tellraw @a [{"text":"Wow,","bold":true},{"text":" look at ","italic":true,"color":"aqua","bold":false},{"text":"all","strikethrough":true,"color":"light_purple","bold":false},{"text":" these nifty ","color":"red","bold":false},{"text":"features","underlined":true,"color":"gold","bold":false},{"text":".","obfuscated":true,"color":"#8A5CF8","bold":false}]
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Datapack IDE?

    Sounds like an excellent plan. Best of luck with the project.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Reducing Attack Speed?

    Yes, you can verify that with /attribute @s minecraft:generic.attack_speed get.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Reducing Attack Speed?

    4 is the attack speed value of the player's punch. In the sword I sent you, I got the value to be half of what the normal sword would be (about 0.8) by setting the operation to addition and a value of -3.2. If you want a value of 2 (which I believe is faster than a regular sword), you can add -2 or multiply by 0.5.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Reducing Attack Speed?

    What the sword is doing is modifying the player's base attack speed of 4 and decreasing that by 20% which happens to be about double what the attacks speed of a player using a sword is. The way default attribute modifiers of weapons get displayed is entirely unique compared to custom attribute modifiers. From what I can tell, if you can manage to set the uuid of your custom attribute modifier to the uuid of the default weapon modifier, it might display in the more conventional way.


    If that dosen't work, ignore the value that the attribute display says and use /attribute @s minecraft:generic.attack_speed get to check the true value. It will probably take some trial and error to get the value you want.


    If the display is too confusing or if you don't like having it, you can use the "HideFlags" tag to get rid of the display entirely.


    If you still want something do display the attribute modifiers, you could create a fake display using lore. I've created an item that dose that if your interested. Just make sure to update the lore if you change the attack damage (the true attack damage is 1+the custom attribute modifier, due to the base attack damage of 1).


    /give RobotNRP diamond_sword{AttributeModifiers:[{Slot:"mainhand",AttributeName:"generic.attack_speed", Name:"generic.attack_speed", Amount:-3.2, Operation:0, UUID:[I; 42853, 1689024593, -201178, -1559272105]},{Slot:"mainhand",AttributeName:"generic.attack_damage", Name:"generic.attack_damage", Amount:6.0, Operation:0, UUID:[I; 42853, 1689024593, -201178, -1559272105]}],HideFlags:2,display:{Lore:['[{"text":" "}]','[{"color":"gray","italic":"false","text":"When in main hand:"}]','[{"color":"dark_green","italic":"false","text":" 7 Attack Damage"}]','[{"color":"dark_green","italic":"false","text":" 0.8 Attack Speed"}]']}} 1

    Let me know if you have any other issues with creating your custom item.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Datapack IDE?

    Sounds pretty neat. Even having a tiny bit of automation when it comes to generating files and tag management would make datapack creation much more convenient. Depending on how far you take it, this has the potential to make datapack creation a lot more accessible.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Is it possible to collect user input in Minecraft 1.15.2?

    To move text from a writable book in the player's inventory into storage, you can run this command. I figured you would want to continue to be able to edit the book multiple times for the purpose of demonstration, so the command is set up to work specifically with the book and quill. Note that this isn't "writing to a command block" as you described, but instead to a file in your world save that you might be able to read with your external program:


    /data modify storage your_storage_name YourCustomNBT set from entity @p Inventory[{id:"minecraft:writable_book"}].tag.pages[0]

    As I have it written, this command will break if there are multiple writable books in the player's inventory. If that's a concern, you can rename the writable book you want to use in an anvil and run this command instead.


    /data modify storage your_storage_name YourCustomNBT set from entity @p Inventory[{id:"minecraft:writable_book",tag:{display:{Name:'{"text":"YourBookName"}'}}}].tag.pages[0]


    Once you get that string into storage, the next step would presumably be to have your program read the storage file in your world save. I can tell you that it's in the "data" folder and will be called "command_storage_your_storage_name.dat" and that it will probably need to be decompressed, but that's my knowledge runs dry.


    Best of Luck with your endeavors.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Is it possible to collect user input in Minecraft 1.15.2?

    I'm sure custom commands like you describe could be made with a mod, but not vanilla minecraft. The closest we have in vanilla is functions which are just a sequence of commands run from a file in a datapack. They don't have parameters in the same way typical commands do, however it is often possible to achieve a similar result (although, I don't think this is one of those cases).


    Another Method I just remembered for storing data that might be perfect for this situation is through what the game calls "storage." Using /data, you can save any datatype to a specific world save file for use in game (or in your case, to read with a python script). With the right command, you could use any nbt string (item name, entity names, books, lore etc.) as your in game input. Or you could just edit the storage nbt directly with /data.


    Let me know if you have any other questions


    Edit:

    Here's some links to the wiki's pages on storage and /data that may be useful.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Is it possible to collect user input in Minecraft 1.15.2?

    The closest thing minecraft has to variables is the scoreboard system. if you use the execute store command, you can set that score to the output of some other command and use that with execute if to determine weather or not a different command should be run. However, there isn't a way to set specific parameters in a command (ex. the coordinates and block id in /fill) equal to a "variable" like you describe. However, in a lot of cases, there are workarounds that produce the same effect. What result are you intending to create?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on display a scoreboard after it has been divided

    What you want is possible, it's just going to require a few more commands. Assuming you need every player to have an independent Delay score, you'll want to create a separate dummy score to use for the display. (My examples use "DelayDisplay") Before you do anything, you'll need to run this command to create a false player to hold the 10 we need to divide.


    /scoreboard players set TenConstant DelayDisplay 10

    Once you've done that, loop this sequence of commands to get you're display.


    /execute as @a run scoreboard players operation @s DelayDisplay = @s Delay

    /execute as @a run scoreboard players operation @s DelayDisplay /= TenConstant DelayDisplay

    /execute as @a run title @s actionbar [{"text":"Delay :"},{"score":{"name":"@s","objective":"Delay"}},{"text":" Display :"},{"score":{"name":"@s","objective":"DelayDisplay"}}]

    Let me know it works or if there are any other issues.

    Posted in: Creative Mode
  • 0

    posted a message on [Tutorial] Campfire chimney smoke without the campfire block

    Sometimes, you just want some of that cozy campfire smoke to liven up your build. However, not every style of chimney has the space available to conceal an entire campfire. I recently encountered this limitation and was able to devise a rather satisfying solution. Instructions for the machine I used are attached below. I recommend constructing it underground, near your build, so it activates when the chunks of the build are loaded. The following details the reasons behind my design for those who are interested or want more customized results.



    The obvious answer to adding smoke to something without any smoke emitting blocks would be to use the particle command. However, using the command as I normally would, with a particle count of 1 or greater, causes the campfire smoke to travel off in random directions, rather than drifting upwards. Instead, by setting the particle count to zero, It becomes possible to set the velocity of the particles by adjusting the "delta". My version of the command uses "0 .0725 0" for the delta and "1" for the speed to send the smoke strait upwards at the same speed smoke moves when produced by the campfire. However, it's entirely possible to have smoke particles moving at any speed and any direction, depending on the look you want. Additionally, the command is set to "force" the particles so they can still render from a distance.


    The next challenge was with how to manage the frequency the command was run. In the actual campfire block, the frequency of the smoke is random, with occasional pauses and sudden clusters of particles appearing unpredictably. This randomness makes the smoke feel more organic and since I want it to look like the smoke is from a fireplace rather than a factory, I needed a way to make the command run randomly. Or at least... it needed to look random. A very simple way to make something that appears random is to combine the outputs of two or more loops that are out of sync with each other. Depending on the timing of the two loops, it can be very difficult to spot patterns in the smoke's appearance. The redstone loop I used has just enough apparent randomness to break up what would otherwise be a very noticeable rhythm. However, It's easy to add more or less apparent randomness by adding more loops and by tweaking the timings of those loops. Finding a nice setup mostly comes down to experimentation. Just make sure if you're making your own loops that they don't end up influencing each other. You'll know this has happened if they speed up over time without player input.


    I've never posted this kind of thing before so let me know if there are ways I can be more clear. I'd love to see how you use this trick, if it comes in handy.

    Posted in: Creative Mode
  • 0

    posted a message on Need some help with my command creation. (Giant AI)

    I'm guessing you're using a team with the collision rule set to "never" to get stop the AI and giant from pushing each other around. If that's true, you probably just need to make sure that that team has been added to the server as well.


    For detecting when the giant takes damage, you can use the "HurtTime" data tag to detect when the giant takes damage. (I personally like the combined sound of the zombie and dragon for that nice guttural rumble.)


    /execute as @e[type=minecraft:giant,nbt={HurtTime:10s}] at @s run playsound minecraft:entity.zombie.hurt hostile @a ~ ~ ~ 1.5 .1
    /execute as @e[type=minecraft:giant,nbt={HurtTime:10s}] at @s run playsound minecraft:entity.ender_dragon.growl hostile @a ~ ~ ~ .5 1.5

    Let me know of any other problems you encounter. It sounds like it's coming together nicely.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need some help with my command creation. (Giant AI)

    Here's what I've come up with for the datapack. Download the "giant_ai_limiter" and put it in the "datapacks" folder in the world save that you are doing this in.


    I went ahead and made it so the giant breaks leaves that are in the way of its path. You can make more blocks breakable just by adding them to the "breakable" list under giant/tags/blocks. Anything that appears when you type "/execute if block ~ ~ ~ ..." is fair game to add. The same goes for "space" which is used to identify blocks the giant can pass through. Just make sure that they both follow the json format if you make any changes.


    One possible reason your rotten flesh command isn't working is because it has to be run before the ravenger is killed. If that's already how you've set it up, then whatever's wrong must be something in the execute part of the command. Double check the target selectors to see if they are finding the entities when they're supposed to.


    Let me know if there are any other issues.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need some help with my command creation. (Giant AI)

    All of the things you've described are possible in vanilla, however, some of them will require a datapack to work most effectively. (However this isn't completely necessary.)


    To detect when the giant is killed, you could check if there is no giant within a radius of the ravenger.


    /execute at @e[type=minecraft:ravager,name=Giant] unless entity @e[type=minecraft:giant,distance=..2] run ...

    When this is the case, you could summon your rotten flesh, play a death sound, and kill the ravenger and zombie.


    /execute at @e[type=minecraft:ravager,name=Giant] unless entity @e[type=minecraft:giant,distance=..2] run summon minecraft:item ~ ~1 ~ {Item:{id:"minecraft:rotten_flesh",Count:64}}

    /execute at @e[type=minecraft:ravager,name=Giant] unless entity @e[type=minecraft:giant,distance=..2] run playsound ...

    /execute as @e[type=minecraft:ravager,name=Giant] at @s unless entity @e[type=minecraft:giant,distance=..2] run kill @s

    When it comes to limiting the size area the ravenger can enter, this is were things get tricky. For starters, you would need a way to detect when the ravenger enters a space that is smaller than you want. The quickest and dirties method of doing this would be to use /execute blocks to compair an area of blocks at the ravenger's position to a predefined region of air in your world. However, this method has two main issues. The first is that if someone where to build in the region your comparing to as your air reference, it would completely break the system. the second is that the giant will only be able to be in air. blocks like torches, carpets, plants, water, cave air, and void air that the giant would logically be able to enter would be treated no differently than solid blocks.


    If either of those things are a problem for you, the most feasible option would be to use a datapack. In datapacks, you are able to make custom categories of blocks with json files. These categories can then be used in commands like /execute if block ... to see if a block matches any of the ones in the category. By creating a category or "tag" as their called for blocks that the giant can enter and then checking the blocks in an area to see if they match the custom category.


    Regardless of what method you use to detect the area around the ravenger, you still need to actually do something when the ravenger enters an area that is too small. A method that might work for that would be to track the giants last position by summoning an area effect cloud and then teleporting the ravenger back to that area effect cloud if the giant enters a space that's too small. the order you run these two commands would look like this.


    /execute as @e[type=minecraft:ravager,name=Giant] at @s unless *blocks in area are can be entered* at @e[tag=GiantLastPosition,sort=nearest,limit=1] run tp @s ~ ~ ~

    /executeat @e[type=minecraft:ravager,name=Giant] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["GiantLastPosition"],Duration:2}

    I highly recommend checking out (if you haven't already) the minecraft wiki's pages on the execute command, entity data format, and player data format. I also recommend poking around in some data packs like the ones on Vanilla Tweaks to see how they're put together. If you're just interested in the end product, I can probably upload a datapack that handles all these things for you. Just tell me if that's something you'd want.


    Let me know how everything goes and if you run into any other issues.

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