• 0

    posted a message on I cant execute at an entity with the nbt NoAI:0/1

    Entities don't have the NoAI tag by default. It's only accessible if you add it through the summon command or /data. So instead of detecting if the value is 0, you can detect if the tag is assigned or not:

    /execute as @e[type=cow] if data entity @s NoAI run say 1
    /execute as @e[type=cow] unless data entity @s NoAI run say 0

    Another reason why your command didn't work is that you need to use the correct data type when testing for NBT. The value of the NoAI tag is a byte so you need to include the letter 'b' after the value (1b).

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to create a dispencer pre-filled with fireworks

    This command is for all 9 slots:

    /setblock ~ ~1 ~ minecraft:dispenser[facing=up]{Items:[{Slot:0b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:1b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:2b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:3b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:4b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:5b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:6b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:7b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}},{Slot:8b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}}]}

    And here's a simplified version with just one slot:

    /setblock ~ ~1 ~ minecraft:dispenser[facing=up]{Items:[{Slot:0b,id:"minecraft:firework_rocket",Count:64b,tag:{Fireworks:{Flight:2,Explosions:[{Type:1,Flicker:0,Trail:0,Colors:[I;11743532,3887386,2437522]}]}}}]}

    You can use an online generator for all the firework settings.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Had a datapack that copied horse stats to a skeleton horse, but 1.16 broke it.

    Just add "minecraft:" to every attribute name. So it's "minecraft:generic.max_health".

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [1.16] How do i add multiple attributes to an item?

    AttributeModifiers is an array (indicated by []) of objects. Each object represents an attribute modifier. Simply add another object to the array like this:

    AttributeModifiers:[{first_attribute},{second_attribute}]
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Getting into Command Blocks - How do I use execute?

    I would do it like this:

    /execute as @a at @s if block ~ ~ ~ water unless score @s SplashOn matches 0.. run say splash
    /execute as @a at @s if block ~ ~ ~ water run scoreboard players set @s SplashOn 1
    /execute as @a at @s if score @s SplashOn matches 1.. unless block ~ ~ ~ water run scoreboard players reset @s SplashOn

    The first command displays "splash" in chat only when the SplashOn objectives is reset (which happens when the player stands on land). The second command sets the objective to 1 if the player is in water and the third command resets the objective if the player is not in water.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Tellraw, hover event and show item. What value should I use?

    value needs to be a tag compound, not a string. If you don't know what a tag compound is, it's basically a pair of curly brackets containing some NBT tags. Example: {id:"minecraft:diamond",Count:1b}. This should work:

    /give @p minecraft:written_book{title:"",author:"",pages:['{"text":"test","hoverEvent":{"action":"show_item","value":\'{id:"minecraft:diamond_sword",Count:1b,tag:{Damage:0}}\'}}']}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Help with, how far mobs can see / hear 1.15

    Idle zombies have this motion: 0.0d,-0.0784000015258789d,0.0d. You can test for those values in the selector like this:

    /execute at @e[type=minecraft:zombie,nbt={Motion:[0.0d,-0.0784000015258789d,0.0d]}] run summon minecraft:snowball ~ ~2.5 ~
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Minecraft functions file structure 1.15.2

    That's the correct file structure. Does your function show up in the autocomplete menu when you type /function and press space? if not, that means there is an error in your function.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Prevent an item from being picked up.

    Stand near the tnt you dropped and run this command:

    /data modify entity @e[type=minecraft:item,limit=1,sort=nearest] PickupDelay set value 32767s

    You can also summon an item that already has the pickup delay set to that value:

    /summon minecraft:item ~ ~ ~ {Item:{id:"minecraft:tnt",Count:1b},PickupDelay:32767s}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard check most or least 1.15.2

    You basically need to loop through all players on the server and check if their score is greater than the current highest score. If it is, tag that player as the highest score holder and repeat the process. Here is one way you could do this:


    (Repeating command block)

    /execute as @a if score @s <objctive> > @a[tag=most,limit=1] <objective> run tag @s add most_t

    (Chain command block)

    /execute if entity @a[tag=most_t] run tag @a remove most

    (Chain command block)

    /tag @a[tag=most_t,tag=!most] add most

    (Chain command block)

    /tag @a[tag=most_t] remove most_t

    To start the sorting process, give a random player the most tag. The algorithm will continuously iterate through everyone's scores and apply the most tag to the player with the highest score. To stop the algorithm, simply remove the tag like this:

    /tag @a remove most

    Note that I only tested this algorithm on armor stands but it should work exactly the same for players.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on 1.15.2 Giving Item enchanted

    Like this:

    /give @p bow{Unbreakable:1b,Enchantments:[{id:"minecraft:punch",lvl:3},{id:"minecraft:power",lvl:10}]}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Mob counting scoreboard

    Repeating command block:

    /execute store result score <player> <objective> run execute if entity @e[type=zombie]

    <player> can be a player, entity, or even a "fake player".

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Teleporting specific types of villagers (vanilla 1.15.2)

    Use full ids (minecraft:<id>) when testing for NBT. So it's type:"minecraft:plains".

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Need some help making a angry bee spawner

    Simply add the Anger NBT tag to SpawnData. This tag is an integer so the max value you can set it to is 2147483647.

    /setblock ~ ~-1 ~ spawner{SpawnCount:3,MaxNearbyEntities:9,SpawnRange:4,Delay:20,MinSpawnDelay:60,MaxSpawnDelay:120,RequiredPlayerRange:9,SpawnData:{id:"minecraft:bee",CustomName:"\"Mad Bee\"",CustomNameVisible:0,Health:10,Anger:2147483647,Attributes:[{Name:"generic.maxHealth",Base:10},{Name:"generic.knockbackResistance",Base:0.03f},{Name:"generic.movementSpeed",Base:0.5f},{Name:"generic.attackDamage",Base:5}],DeathLootTable:"mctools:entities/Mad_Bee"}}
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Help! Armour Stand mobs not working.

    The issue is in your teleportation command. Because you used @e, it teleports all armor stands tagged "P1" to the same cow. Use @s instead of @e and it should work. To remove the armor stand:

    /execute as @e[tag=P1] at @s unless entity @e[tag=P1B,distance=..0.3] run kill @s
    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.