7a32634ddc | ||
---|---|---|
locale | ||
locations | ||
sounds | ||
textures | ||
LICENSE | ||
README.md | ||
callbacks.lua | ||
config.txt | ||
deserializer.lua | ||
formspec.lua | ||
init.lua | ||
items.lua | ||
load_config.lua | ||
mod.conf | ||
player_manager.lua | ||
privs.lua |
README.md
Magic Compass
Teleport system for Minetest (yes, GUI aspect will be improved)
How to use it
Look for the "Magic Compass" item in your creative inventory, put it in your hand and left click it to open the locations menu
Customisation
Create new locations
Every icon in the menu is a location. Locations must be declared in a .txt document inside the locations
folder like so:
Red Forest -- the name you want to show in the menu when hovering the icon
magiccompass_redforest.png -- the associated texture
-3.5, 5.0, -20.5 -- where the player will be teleported
5 -- (optional) cooldown before being able to use it again. Leave empty or put -1 for none
interact, myrpg_lv10 -- (optional) privileges required in order to use it. Use ", " to separate them or it won't work
HIDE -- (optional) whether to hide the icon to players who don't have the required privileges
The file name is important too, as it must start with a number followed by an underscore like 5_whatever name.txt
.
The number indicates the position of the associated item in the grid (which scales according to the highest number declared), and empty spaces are generated automatically if the numbers of the items don't represent a full sequence.
Callbacks
magic_compass.register_on_use(function(player, ID, item_name, pos))
: use it to run more checks BEFORE using the item. If it returns nil or false, the action is cancelled. If true, it keeps goingmagic_compass.register_on_after_use(function(player, ID, item_name, pos))
: use it to run additional code AFTER having been teleported
Graphic aspect
Edit config.txt
to suit your needs!
Want to help?
Feel free to:
- open an issue
- submit a merge request. In this case, PLEASE, do follow milestones and my coding guidelines. I won't merge features for milestones that are different from the upcoming one (if it's declared), nor messy code
- contact me on the Minetest Forum