HomeJavaDatapacksFTMC TouchSign Datapack
FTMC TouchSign Datapack
DatapacksJava

FTMC TouchSign Datapack

by flashteens · on Modrinth

A datapack framework that gives your datapack the ability to tell which part of a wall sign that a player clicked on. Works in Vanilla Minecraft 1.13…

Which Minecraft do you have?

Every version of the game needs its own build. Pick yours, then download — the wrong build installs fine and then does nothing in the game. This mod is built for Data pack only.

⬇ Download for 1.21.5⬇ Download for 1.21–1.21.4⬇ Download for 1.20.5–1.20.6⬇ Download for 1.20–1.20.4⬇ Download for 1.14–1.19.4⬇ Download for 1.13–1.13.2
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.
FTMC TouchSign Datapack — screenshot 1

This is a datapack framework that lets you use a sign like a touchscreen. In other words, it gives your datapack the ability to tell which part of a wall sign that a player clicked on.

How to use this framework:

Step1. Download this datapack framework & put it into the datapack folder in your map. Please check your Minecraft version and download the corresponding datapack from one of the links on this page.

Step2. Make your own datapack and put it into the same datapack folder.

In your datapack, there must be an mcfunction file that invocates the FTMC TouchSign framework, so you will get some information about the clicking position.

For an example, we create a file called onclick.mcfunction and put it in your datapack:

function ftmc:touchsign/click_handler
execute if score @s fttsign_touchx matches <X1>..<X2> if score @s fttsign_touchy matches <Y1>..<Y2> run <YourAction1>
execute if score @s fttsign_touchx matches <X3>..<X4> if score @s fttsign_touchy matches <Y3>..<Y4> run <YourAction2>
# Please replace X1 ~ X4 and Y1 ~ Y4 above with the exact coordinate values.

In this function, fttsign_touchx and fttsign_touchy refers to the coordinates that the player clicks onto the sign.

The example above will make your sign run <YourAction1> when clicking on the pink zone of the following screenshot & and run <YourAction2> when clicking on the green zone below: The screenshot that demonstrates the X-Y coordinates from the example code

Step3. Make a clickable sign and obtain the sign with a /give command. Some examples can be seen on the demo folders of this project.

Click on the links below for the example in each corresponding Minecraft version:

When to use this framework in my project

This framework provides several demo examples as follows:

All these examples can be found in the source code & you may obtain the sign items by running any of the commands like /function ftmc:touchsign/demo/give_xxxxx_sign (where xxxxx should be replaced.)

These usages are just a few examples. You might still discover quite some other interesting and practical usages. Feel free to publish your own datapack that uses this framework as long as you follow the "Usage Terms" section written below. Hope you enjoy! 😄

FAQs

  1. I'm creating a new map and trying to import the FTMC TouchSign datapack, but it tells me "Incompatible!"

    • Please first ensure that the datapack you downloaded corresponds to the correct Minecraft version.
    • If correct, please ignore the "Incompatible" warning and import it into your world anyway. It should be still working.
    • If you found any issues in the gameplay, please report it as a bug in the GitHub issues page.
  2. The datapack doesn't correctly detect the clicking position when I'm going far away from the spawn point.

    • Due to the limitations of scoreboard data types (32-bit signed integers) combining with some multiplication operations, we only expect it work properly when X and Z coordinates range within about ±2,147,000 blocks from the spawn point. This issue might happen if you go outside from this range.

Source Code

See on my GitHub repository.

Usage Terms

This project is licensed under a Creative Commons BY-SA 4.0 License.

Feel free to use and share this datapack for any public or private usages as long as:

Quick facts

Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more