- **New: Hide an entity from single players: `Entity:setHiddenFrom` and `isHiddenFrom`**
- `entity:setHiddenFrom(player, hidden)` hides the entity from one player, or from a list of players, and `entity:isHiddenFrom(player)` tells whether it is hidden from that player.
- A player the entity is hidden from is not told about it at all: they don't see it, its equipment or its name, and they can neither hit it nor click it nor be pushed by it. All other players see it as before.
- The entity itself is not changed. It still acts on the player it is hidden from, so a hidden zombie still hurts them, and that player still hears its sounds and sees what it shoots. A hidden player keeps their entry in the player list.
- This is independent of `invisible` and of `LivingEntity:setHidden`, which hide something from all players alike.
- The settings are not saved. A hidden player keeps them through death and respawn, and loses them at logout. To hide an entity from the players who join later, hide it from each of them at their `PlayerJoinedEvent`.
```lua
-- A marker that only the owner of this spell sees
local marker = spell:summon("armor_stand")
local owner = spell.owner
for _, player in ipairs(spell:findEntities("@a")) do
if player ~= owner then
marker:setHiddenFrom(player, true)
end
end
```
- **New: A mob can hold a spot: `MobEntity:startStay` with `pos` and `radius`**
- With `pos`, the mob walks to that position first and stays there. With `radius`, it may be moved that many blocks off its spot; when a hit, a push or a current moves it further, it walks back.
- Without `pos`, its spot is the place where it stands when the task starts. Without both options `startStay` works as before: the mob stays where it ends up.
- `duration` counts from when the mob first stands on its spot. `searchRange` and `speed` apply to the way there.
- While the mob holds its spot, `task` also carries `pos`, `radius` and `away`, which is `true` while it is on its way to the spot.
```lua
guard:startStay({ pos = post, speed = 1.3 })
other:startStay({ radius = 3 })
```
- **Fix: `str` and `inspect` show the fields of an object again**
- For a `Block`, a `Vec3` and every other instance of a class they printed only e.g. `<Block 1>`. They show the fields again, as before 6.0.0.
- **Fix: `PlayerHandSwingEvent` fired twice for a right click at a block on Minecraft 26.3**
- Placing a block, pulling a lever or opening a chest fired the event twice. It fires once now, as on the other versions.
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }