Tags
Creators
Details
6.3.0-26.1.1
Compatibility
Changes
-
New: Ask whether an entity sees another one:
LivingEntity:canSeeentity:canSee(other)tells whether no block is in the line of sight from the entity's eyes to the other entity's eyes, the way the game decides whether a mob sees its target.- Only blocks are in the way, not other entities, and which way the entity looks doesn't count: it also "sees" what is behind it.
- It is always
falsefor an entity in another world, or more than 128 blocks away. entity:canSee(other, range)shortens how far the entity sees, in blocks from eyes to eyes: a short-sighted guard, or a mob that notices a player only close by. 128 blocks remain the most: a largerrangechanges nothing.local zombie = spell:summon("zombie") --[[@as LivingEntity]] if zombie:canSee(spell.owner) then print("The zombie sees you.") end if zombie:canSee(spell.owner, 8) then print("The zombie sees you from close by.") end
-
New: Read and set a player's hunger:
Player.foodLevelandPlayer.saturationplayer.foodLevelis the food level, an integer from 0 to 20. See Hunger.player.saturationis the saturation, from 0 up to the food level: a larger value is cut down to it. See Saturation.- Both can be assigned, for example to start a round with every player fed.
for _, player in ipairs(spell:findEntities("@a")) do ---@cast player Player player.foodLevel = 20 player.saturation = 5 end
-
New: Read the game's difficulty:
Server.difficultyspell.server.difficultyis "peaceful", "easy", "normal" or "hard". All worlds of the server share it, and a hardcore world is always "hard".- It is read-only: change it with the command
/difficulty.if spell.server.difficulty == "hard" then print("Skeletons shoot twice as often.") end
-
New: Turn the spell to a position:
Spell:lookAtspell:lookAt(pos)sets the spell'syawandpitchso that it looks at the position. A raycast from the spell then leads there.- Looking straight up or down, the spell keeps its yaw.
spell:lookAt(spell.owner.eyePos) local hit = spell:raycastBlock(20) print(hit and "A block is in the way." or "Nothing between us.")
-
Change: A mob that follows or chases searches wider before it gives up at a dead end
- A mob with
startFollow, or one that chases withstartAttack, walked to where its path ended, at the foot of a cliff or at a wall, and its task failed there with "unreachable", although a way led around: the way was longer thansearchRange. - Now the mob searches again from such a dead end, up to 4 times as far as
searchRange. Only when that search finds no way either, the task fails with "unreachable", as before. - A mob that used to stop at a wall with a long way around it now takes that way.
- A mob with
-
Fix:
PlayerInventoryaccepts additional properties, like every other objectplayer.inventory.myNote = "..."raised "attempt to modify unknown table index". Now a spell can keep its own values on an inventory, as it can on a player or an item.
-
Fix:
LivingEntity.hostileistruefor every enemy mob- It was
falsefor the slime, magma cube, ghast, phantom, shulker, hoglin and ender dragon. A spell that picks its targets byhostilenow finds these seven, too. - Nothing else changes: neutral mobs like the wolf, the bee and the iron golem are still not hostile, and the enderman, the piglin and the zombified piglin still are.
- It was
Supplementary resources
| File | Type | Size | |
|---|---|---|---|
| wizards-of-lua-6.3.0-26.1.1-sources.jar | Sources jar | 416.6 KiB |
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:HW3198Ve:vURgAcQ9"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:HW3198Ve:vURgAcQ9"
}

