Tags
Creators
Details
Licensed LGPL-3.0-or-later
Published 2 years ago
Updated 28 minutes ago
All versions
8.0.0-26.2
Release
Wizards of Lua 8.0.0-26.2 (NeoForge)3 weeks ago 19
Compatibility
Minecraft: Java Edition
26.2
Platform
NeoForge
Supported environments
Server-side
Singleplayer
Changes
- Breaking Change:
assertanderrorare plain Lua again- They took a format like
string.format. That broke messages with a%in them, even of anassertthat passed,errorwith a table, and the level oferror. A message with values now needsstring.format:assert(radius >= 1, string.format("The radius must be at least 1, not %d.", radius))
- They took a format like
- Breaking Change: An unknown block or item id is an error
Block:new("stne")gave air, sospell.block = Block:new("stne")deleted the block there, andItem:new("stne")gave an empty item, all without a word. Now they raise an error, and so do the ignored block ids ofspell:copyStructureandspell:pasteStructure, where a misspelled id left out all air.
- Breaking Change: PlayerDropItemEvent can be canceled, and
event.droppedItemis nowevent.item- The event now comes before the item leaves the player, so it carries an
Iteminstead of anItemEntity. A canceled item goes back into the inventory; if it can't, it is deleted, so it never drops. What a player loses on death fires no event.
- The event now comes before the item leaves the player, so it carries an
- Breaking Change: raycast and raycastBlock return
nilif nothing was hit- For spells and entities alike, as
raycastEntityalways did. They gave a result of the type"miss"before, with its position at the end of the ray, soif hit thenwas always true.HitTypehas no"miss"any more.
- For spells and entities alike, as
- Breaking Change: Item components are read without the namespace
minecraft:item.nbt.components.custom_nameinstead ofitem.nbt.components["minecraft:custom_name"], also in the components of the enchantments and of items in chests, entities and structures. Keys incustom_datastay as they are. Writing and NBT paths take both forms.
- Breaking Change:
WizardsOfLua.setCommandrefuses a pattern that could never run- A placeholder next to an argument of an existing command, like
time set %i, was accepted, but Minecraft always took its own command. It now raises an error. New words still work, liketime warp %i.
- A placeholder next to an argument of an existing command, like
- Breaking Change: String patterns work on bytes, as in Lua 5.3
string.find,match,gmatchandgsubworked on decoded text while#,subandbytecount bytes, sos:sub(s:find("x"))was off in a text with an umlaut, andgsubdamaged binary data. Now a.takes one byte, which is half of anä, and classes mean what they mean in Lua:%a,%land%utake only A to Z,%pall punctuation,%sand%conly ASCII. To go through a text by characters, useutf8.charpattern.
- Breaking Change:
SpellFinishEventis now SpellFinishedEvent- Change the name where a spell collects or intercepts it. The event finally has a page in the docs: it comes however a spell ends, also when it fails or is broken.
- Breaking Change: A canceled event reaches no event queue
- The interceptors of all spells now run before any queue gets an event, whichever spell was cast first. So a queue gets the event with what they changed. A canceled event used to reach the queues of spells cast before the one that canceled it.
- A
PermissionCheckEventthat an interceptor answered is not canceled, so it reaches every queue.
- Breaking Change: Entity.extra keeps what a spell stores
- A boolean came back as the number
1or0, and0is true in Lua, so a storedfalsecounted as true. It now comes back as a boolean. A spell that compares such a value with1must compare withtrue. What a spell wrote back throughentity.extrabefore this version stays a number. - Entity:putExtra only merges tables now. A value took the type of the old one, so
8.5over8lost its fraction, and a list left the end of a longer one in place.
- A boolean came back as the number
- New: Block, Item, ItemEntity and Trace can be called like
Vec3Block("stone")is short forBlock:new("stone"),Item(id, nbt)forItem:new(id, nbt),ItemEntity(item, nbt)forItemEntity:new(item, nbt)andTrace()forTrace:new().
- New: Block:new takes the block's data
Block("oak_stairs", { facing = "east", half = "top" })sets the block's properties at once. A property the block doesn't have raises an error.
- New: World:getBiome
- Gives the biome at any position, without loading a chunk.
- New: Entity.team
- The name of the scoreboard team an entity or a player is in.
- New: Entity.vehicle
- The entity something rides on, like a boat.
- New: Player.mayFly and Player.flySpeed
- Let a player fly, and set how fast. Written through NBT, these never reached the player's client.
- New:
spell:interceptandspell:collecttake a name or a list of names - New: The utf8 library works
utf8.len,utf8.offsetand the others used to raise "function not implemented". Use them to count and cut text by characters.
- New: A bot builds a wall three rows high
- Bot:startPlaceBlock jumps and clicks in the air when the side to place against is just above its eyes.
- New: A following bot can share a boat
- With
boats, Bot:startFollow makes a bot get into the boat of the entity it follows, and out again with it. The squire of the Squire example does this with its player.
- With
- New: A bot can answer a dialog
- Bot.dialog and the BotDialogEvent tell what a player would see, and Bot:clickDialog presses a button and fills in a form, so a spell can play-test a dialog. It also tells when a client would ask its player for confirmation first. Dialogs need Minecraft 1.21.6 or newer.
- New: PermissionCheckEvent on NeoForge
- It fires for the checks of Wizards of Lua: its commands and the dynamic commands, whose permission is their
id. So on both loaders a spell can decide who may use a dynamic command. The checks of other mods stay out of reach on NeoForge.
- It fires for the checks of Wizards of Lua: its commands and the dynamic commands, whose permission is their
- New: Dynamic commands can take the values that Lua code finds
choicesin WizardsOfLua.setCommand gives a%sa list that comes from a spell, like the names of a player's homes. A player gets it as suggestions, and any other value is refused. More in the docs.
- New: The placeholders
%block,%worldand%entitytypefor dynamic commands - New: Bot:getSuggestions
- Tells what a player would be offered at the end of a command they're typing.
- New: Spells can use the network: Http and WebSocket
Http:requestcalls web services, and encodes query values, forms and file uploads for you. A socket stays connected to one. A spell only reaches the hosts you list inconfig/wizards-of-lua/net.luaconf, and that list starts empty. More in the docs.
- New: Json
Json:encodeandJson:decode, also for JSON files in the world folder.
- New: The Discord bridge example
- Connects the chat of your server with a Discord channel, in both directions. How to set it up.
- Fix: Two blocks of the same kind no longer share their
dataBlock:newandspell.blockgave the same object for all blocks that looked alike, so changing thedataof one changed the others too. Each is its own copy now.==still compares a block's type and data, but two equal blocks are two different keys in a table.
- Fix: A mob's
lookVecand raycasts follow its head- They followed its body, so after
mob.lookAt = pig,mob:raycast(10)went where the body pointed.
- They followed its body, so after
- Fix:
/mefiresChatMessageEventon every Minecraft version- It did only on 26.3.
- Fix:
/wol extract examples overwritedeletes nothing if there is nothing to extract- It emptied the folder first, and deleted the folder itself, which failed if anything had it open. A failure is now said in words.
- Fix:
blockEntity.nbt = copywithItems = {}no longer logs a warning - Fix: A bot's skin lookup tries again after a time-out at Mojang
- Fix: A position without a number gives a clear error
mob.lookAt = {}and the like gave a Java error instead of saying what is wrong.
- Fix: An interceptor can change the item of
PlayerDropSelectedItemEvent, also if other spells are running- With another spell running,
evt.itemofPlayerDropSelectedItemEventwas a copy, so changing it did nothing.
- With another spell running,
- Fix:
Player.mainHandItemisnilfor a hand that was emptied- After the last item of a stack had been dropped or used up, it gave an air item with
count0 instead ofnil.
- After the last item of a stack had been dropped or used up, it gave an air item with
- Fix: In an event queue,
evt.itemofPlayerUseItemEventis the item that was used- It showed what was in the hand by the time the spell read it, so the last item of a stack looked like air.
Supplementary resources
| File | Type | Size | |
|---|---|---|---|
| wizards-of-lua-neoforge-8.0.0-26.2-sources.jar | Sources jar | 598.25 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:DOyScyiq"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:HW3198Ve:DOyScyiq"
}

