Looking at the code, I'm 99% sure this mod is ai generated. And this user has a history of making AI mods. If this mod was actually written by hand, let me know and I'll change this review. This mod doesn't disclose that it was made with AI.
It's a small and simple mod, but I have some criticisms:
It uses the old minetest namespace for a mod created after the name change. You should use core instead. core is backwards compatible with pre-name-change versions.
It uses a label formspec element instead of a textarea with no name. Since you don't need to send any information back to the server, you could've used a read-only textarea. With a no name textarea, it can still be copy-pasted, and the player can't modify the itemstring text. (Why would the player want that?)
It checks if the stack is empty twice. The full_itemstring function, which checks if the stack is empty, is called after checking if the stack is empty in the cmd_func function.
Sending messages to chat is unnecessary and cluttered, when we already have a formspec. It sends the itemstring in the chat, and "Shown." when the command is run. The chat itemstring can't be copy-pasted and we already have it in the formspec so what is the point?
Calling minetest.chat_send_player(name, "[itemstring] " .. istr) right before return true, "Shown." in a core.register_chatcommand function is redundant, because it already sends the string you wrote in the return statement to the player when the command is run. You could've wrote return true, "[itemstring] " .. istr .. "\n" .. "Shown." to output the same thing.
I'm sure there's more code issues, but I'm going to stop there. I'm sure if this mod was written by a human, there would be less issues like this. Or if this mod was actually written by a human, they should learn to not make code smells similar to generative AIs.
A godsend for modders
I've been looking for exactly this kind of mod, ty!
Note to modders: If you're using this to add support for other games to your mod, first try the dedicated compatibility mod "xcompat".
Корисно
Швидко й зручно
This mod is likely AI generated
Looking at the code, I'm 99% sure this mod is ai generated. And this user has a history of making AI mods. If this mod was actually written by hand, let me know and I'll change this review. This mod doesn't disclose that it was made with AI.
It's a small and simple mod, but I have some criticisms:
minetest
namespace for a mod created after the name change. You should usecore
instead.core
is backwards compatible with pre-name-change versions.label
formspec element instead of atextarea
with no name. Since you don't need to send any information back to the server, you could've used a read-only textarea. With a no nametextarea
, it can still be copy-pasted, and the player can't modify the itemstring text. (Why would the player want that?)full_itemstring
function, which checks if the stack is empty, is called after checking if the stack is empty in thecmd_func
function.minetest.chat_send_player(name, "[itemstring] " .. istr)
right beforereturn true, "Shown."
in acore.register_chatcommand
function is redundant, because it already sends the string you wrote in the return statement to the player when the command is run. You could've wrotereturn true, "[itemstring] " .. istr .. "\n" .. "Shown."
to output the same thing.I'm sure there's more code issues, but I'm going to stop there. I'm sure if this mod was written by a human, there would be less issues like this. Or if this mod was actually written by a human, they should learn to not make code smells similar to generative AIs.