331: Run command every n ticks to player near tagged entity. [Minecraft Map Making]

Subscribers:
3,590
Published on ● Video Link: https://www.youtube.com/watch?v=5UcWEHAPyOM



Minecraft
Game:
Minecraft (2011)
Duration: 9:23
332 views
10


Ep331: Run a command every n ticks when the player is a certain distance from a tagged mob. In this example we are playing a sound every 30 ticks when a player is within 5 blocks of an iron golem tagged with monster.

Updated version - Ep 335:    • 335: UPDATED: Run command every n tic...  

Version: 1.19

Requested by: jasper

Commands, builds and ideas for people making their own Minecraft maps.

Check out my collabs on Coppit's channel:    / coppitj  

Join the CoppitCraft server that I play on and the Discord where I hang out.
Server IP: 51.81.246.145:25588
Discord:   / discord  

The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.

Since angled brackets are not allowed in YouTube descriptions you will have to replace "greater than" with the appropriate angled bracket. Ascii code: 62

Commands used:

Setup:
IUN: scoreboard objectives add timer dummy
CUA: scoreboard objectives add in_range dummy

Summon:
IUN: summon iron_golem ~ ~ ~ {Tags:["monster"]}

Controller:
RUA: execute as @a at @s store success score @s in_range if entity @e[type=iron_golem, tag=monster, distance=0..5]
CCA: scoreboard players add @a[scores={in_range=1}] timer 1
CCA: execute as @a[scores={timer=30..}] run scoreboard players set @s timer 0
CCA: execute as @a[scores={in_range=1, timer=0}] at @s run playsound entity.warden.heartbeat master @s ~ ~ ~ 1 1 0




Other Videos By Infernal Device


2024-06-06341: Top down camera view, remote controlled entity with button detection. [Minecraft Map Making]
2024-06-05340: Moving mechanical chain decoration. [Minecraft Map Making]
2024-06-04339: Rotating room. [Minecraft Map Making]
2024-06-03338: Tool for detecting and counting hidden ores. [Minecraft Map Making]
2024-06-02337: Concept: Magic staff with homing missiles. [Minecraft Map Making]
2024-05-31336: Checking light levels at the players position. [Minecraft Map Making]
2024-05-30335: UPDATED: Run command every n ticks to player near tagged entity. [Minecraft Map Making]
2024-05-30334: Waystones. [Minecraft Map Making]
2024-05-29333: Text display force fields. [Minecraft Map Making]
2024-05-29332: Villager dialogue using clickable tellraw. [Minecraft Map Making]
2024-05-27331: Run command every n ticks to player near tagged entity. [Minecraft Map Making]
2024-05-26330: Fireflies in a jar as a light source. [Minecraft Map Making]
2024-05-24329: Placing saved structures with commands. [Minecraft Map Making]
2024-05-23327: Updated: Will o the wisp that leads players to a POI. [Minecraft Map Making]
2024-05-23326: Alternate: Entity following entity. [Minecraft Map Making]
2024-05-23CoppitCraft Castle 049: Cannons and crenellations.
2024-05-23328: Command that has a random chance to run using a Predicate. [Minecraft Map Making]
2024-05-23325: Two quick tips for faster building. [Minecraft Map Making]
2024-05-22324: Will o the wisp that leads players to a POI. [Minecraft Map Making]
2024-05-21323: Playing with particles. [Minecraft Map Making]
2024-05-20322: Is the player sneaking and similar predicates: No datapack needed. [Minecraft Map Making]



Tags:
minecraft
adventure map
map making
commands
command blocks
1.18
custom commands
redstone
map ideas
map suggesstions
custom maps
1.19



Other Statistics

Minecraft Statistics For Infernal Device

At present, Infernal Device has 181,722 views spread across 860 videos for Minecraft, accounting for over 10 days of watchable video on his channel. This is 94.82% of the total watchable video for Minecraft on Infernal Device's YouTube channel.