311: Controlling a wandering trader. [Minecraft Map Making]
Ep311: Various ways to change a wandering trader's wander target.
Version: 1.19
As used in episode 300 - Playing fetch with a fox: • 300: Playing fetch with a fox. Experi...
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 temp_value dummy
CUA: scoreboard objectives add location_id dummy
CUA: scoreboard objectives add location_updated dummy
Summon:
IUN: summon wandering_trader ~ ~ ~4 {Tags:["myTrader"]}
Set directly:
IUN: execute as @e[tag=myTrader] run data modify entity @s WanderTarget.X set value 14
CUA: execute as @e[tag=myTrader] run data modify entity @s WanderTarget.Y set value 56
CUA: execute as @e[tag=myTrader] run data modify entity @s WanderTarget.Z set value 373
Set from storage:
IUN: data modify storage trader:data WanderTarget set value {X:14, Y:56, Z:373}
CUA: execute as @e[tag=myTrader] run data modify entity @s WanderTarget set from storage trader:data WanderTarget
Clear storage:
IUN: data remove storage trader:data WanderTarget
Save entity pos to storage:
IUN: data modify storage trader:data WanderTarget.X set from entity @e[limit=1,type=item, sort=nearest] Pos.X
CUA: data modify storage trader:data WanderTarget.Y set from entity @e[limit=1,type=item, sort=nearest] Pos.Y
CUA: data modify storage trader:data WanderTarget.Z set from entity @e[limit=1,type=item, sort=nearest] Pos.Z
CUA: execute as @e[tag=myTrader] run data modify entity @s WanderTarget set from storage trader:data WanderTarget
Change storage element:
IUN: data modify storage trader:data WanderTarget.X set value 380
CUA: execute as @e[tag=myTrader] run data modify entity @s WanderTarget set from storage trader:data WanderTarget
Increment storage element:
IUN: execute store result score #pos temp_value run data get storage trader:data WanderTarget.X
CUA: scoreboard players add #pos temp_value 10
CUA: execute store result storage trader:data WanderTarget.X int 1 run scoreboard players get #pos temp_value
CUA: execute as @e[tag=myTrader] run data modify entity @s WanderTarget set from storage trader:data WanderTarget
Execute if trader has no target:
RUA: execute as @e[tag=myTrader, nbt=!{WanderTarget:{}}] run say No target!
Execute if trader has a target:
RUA: execute as @e[tag=myTrader, nbt={WanderTarget:{}}] run say I have a target!
Set location array:
data modify storage trader:data WanderTarget set value [{X:14, Y:56, Z:373},{X:14, Y:56, Z:383},{X:24, Y:56, Z:383}]
Set location ID:
IUN: scoreboard players set @e[tag=myTrader] location_id 0
Give trader locations in sequence:
RUA: execute as @e[tag=myTrader, nbt=!{WanderTarget:{}}] run tag @s add no_target
CUA: execute as @e[tag=no_target, scores={location_id=0}] store success score @s location_updated run data modify entity @s WanderTarget set from storage trader:data WanderTarget[0]
CCA: scoreboard players add @e[tag=myTrader] location_id 1
CUA: execute as @e[tag=no_target, scores={location_id=1}] unless score @s location_updated matches 1 store success score @s location_updated run data modify entity @s WanderTarget set from storage trader:data WanderTarget[1]
CCA: scoreboard players add @e[tag=myTrader] location_id 1
CUA: execute as @e[tag=no_target, scores={location_id=2}] unless score @s location_updated matches 1 run data modify entity @s WanderTarget set from storage trader:data WanderTarget[2]
CCA: scoreboard players set @e[tag=myTrader] location_id 0
CUA: scoreboard players reset @e[tag=myTrader] location_updated_updated
CUA: tag @e[tag=no_target] remove no_target
Other Videos By Infernal Device
Other Statistics
Minecraft Statistics For Infernal Device
At present, Infernal Device has 181,586 views spread across 859 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.