💡 Setup:
tag @p add init
summon pig ~ ~1 ~ {Tags:["init"],NoAI:1b}
scoreboard players add .global sid 1
scoreboard players operation @e[type=pig,sort=nearest,limit=1,tag=init] sid = .global sid
scoreboard players operation @p[tag=init] sid = .global sid
tag @e remove init
💡 Find Link:
execute as @a at @s as @e[type=pig] if score @s sid = @p sid run tp @s ~ ~ ~
BONUS FOR DATAPACKERS:
you can use in selectors: @e[predicate=(this)] given this predicate that compares scores:
{
"condition": "minecraft:value_check",
"value": {
"type": "minecraft:score",
"target": "this",
"score": "test"
},
"range": {
"min": {
"type": "minecraft:score",
"target": {
"type": "minecraft:fixed",
"name": ".search"
},
"score": "test"
},
"max": {
"type": "minecraft:score",
"target": {
"type": "minecraft:fixed",
"name": ".search"
},
"score": "test"
}
}
}
🔵 Discord Server: [ Ссылка ]
💻 Website: [ Ссылка ]
🐺 Twitter: [ Ссылка ]
Music:
"Werq" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
All Songs Used under fair copyright. Lincenses Below:
License for commercial use: Creative Commons Attribution 4.0 Unported "Share Alike" (CC BY-SA 4.0) License.
Full License HERE - [ Ссылка ]
![](https://i.ytimg.com/vi/685vs5hNQmk/maxresdefault.jpg)