#✅ | where did i make a mistake

1 messages · Page 1 of 1 (latest)

broken cliffBOT
#

It looks like you're trying to use the nbt_data_get placeholder within a calc placeholder, which is a great use case! However, the block_pos parameter is only needed when source_type is set to block, not entity (as you have correctly set for the player).

You've included an empty block_pos tag. While it might not cause a direct error, it's unnecessary when querying an entity. Let's simplify that! 😉

Here's the corrected version:

{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"nbt_data_get","values":{"source_type":"entity","entity_selector":"@s","nbt_path":"foodSaturationLevel","scale":"1.0","return_type":"value"}}"}}

You can find more details about the nbt_data_get placeholder and its usage in the documentation here: NBT Data Placeholder

proper totem
#

still not working

broken cliffBOT
# proper totem still not working

I see. 🤔 Can you tell me what happens when you try to use it? Are you getting an error message in-game, or does it just show nothing?

Also, could you please provide a bit more context? For example:

  • What element are you trying to use this placeholder in (e.g., a Text element, a Ticker element)?
  • Are you using a recent version of FancyMenu (v3.6.0+)? The nbt_data_get placeholder was introduced in that version.
  • Are you in a world when testing this? Some placeholders, especially those related to player data, only work when in-game.

This information will help me understand why it's not working for you! 😊

proper totem
#

make me placeholder that checks players foodSaturation level and multiplies it by 5

broken cliffBOT
# proper totem make me placeholder that checks players foodSaturation level and multiplies it b...

Certainly! ✨ Here's a placeholder that checks the player's food saturation level and then multiplies that value by 5:

{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"nbt_data_get","values":{"source_type":"entity","entity_selector":"@s","nbt_path":"foodSaturationLevel"}} * 5"}}

Let's break down how this works:

  • The inner part {"placeholder":"nbt_data_get", ...} retrieves the current foodSaturationLevel of the player (@s for self).
  • The outer {"placeholder":"calc", ...} then takes that value and multiplies it by 5.
  • "decimal":"true" ensures that the result includes decimal places if the saturation level is not a whole number.

You can find more information about the calc placeholder in the Placeholders documentation and about retrieving player data with nbt_data_get in the NBT Data Placeholder documentation.

proper totem
#

again but from the scratch

broken cliffBOT
# proper totem again but from the scratch

Okay, let's build this from scratch together, step by step! ✨

I understand you want a placeholder that:

  1. Reads the player's current food saturation level. This is a numeric value that indicates how much saturation the player has.
  2. Multiplies that number by 5.

Here's how we construct it:

Step 1: Get the Player's Food Saturation Level

To get data from the player (an entity), we use the nbt_data_get placeholder. This placeholder allows us to access NBT (Named Binary Tag) data. For player-specific NBT data, we use the entity source_type and @s (which stands for "self," referring to the current player) for entity_selector. The specific NBT path for food saturation is foodSaturationLevel.

Here's the placeholder for that:

{"placeholder":"nbt_data_get","values":{"source_type":"entity","entity_selector":"@s","nbt_path":"foodSaturationLevel"}}

This will return a number, like 5.0 or 10.5.

Step 2: Perform the Multiplication

Now that we have the saturation level, we need to multiply it by 5. For any mathematical operation, we use FancyMenu's calc (calculator) placeholder.

The calc placeholder needs two main things:

  • "decimal":"true" or "false": Do we want the result to include decimal points? Yes, saturation can be a decimal, so we want this to be true.
  • "expression":"your_calculation_here": This is where we put our math problem.

Inside the expression, we'll embed the placeholder from Step 1.

So, the basic structure for the calc placeholder will be:

{"placeholder":"calc","values":{"decimal":"true","expression":" [PLACEHOLDER_FROM_STEP_1] * 5 "}}

Step 3: Combine Them!

Now, let's take the placeholder from Step 1 and insert it directly into the expression part of the calc placeholder from Step 2:

#
{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"nbt_data_get","values":{"source_type":"entity","entity_selector":"@s","nbt_path":"foodSaturationLevel"}} * 5"}}

This combined placeholder will first evaluate the nbt_data_get part to get the saturation level, and then the calc part will take that number and multiply it by 5.

This placeholder should work exactly as you're intending! 😊

For more details, you can always refer back to the documentation:

proper totem
#

not working

broken cliffBOT
# proper totem not working

I'm sorry to hear it's still not working for you. 😔 It's tricky without being able to see exactly what's happening on your end.

To help me understand the issue better, could you please provide some more context?

  1. Where are you trying to use this placeholder? (e.g., in a Text element's content, within another element's settings, in an action script, etc.)
  2. What specifically is "not working"?
    • Does it show up as the raw placeholder text {"placeholder":"calc", ...}?
    • Does it show an empty string or 0?
    • Does it show an error message? If so, what is the error?
  3. Are you currently in a Minecraft world (singleplayer or multiplayer) when testing? This placeholder requires being in-game to fetch player data.
  4. Are you using FancyMenu v3.6.0 or newer? The nbt_data_get placeholder is only available from that version onwards. You can check your FancyMenu version in the mods list.
  5. Could you double-check for any typos? Even a single misplaced quote or bracket can cause issues.

If you could provide a screenshot of where you've input the placeholder, and what you see in-game, that would be incredibly helpful! Or, if there's an error in your Minecraft latest.log file, sharing that would also give us a lot of information. You can find the latest.log file in your Minecraft instance's /logs/ folder.

#
Thread Marked as Solved

This support thread has been marked as solved by @proper totem.

The AI helper is now disabled, but you can still continue the conversation if needed. Thank you for using our support system!

#

✅ | where did i make a mistake

proper totem
#
  1. spiffyhud, in a hud obviously
  2. it doesn't work at all, i have a ticker that checks player foodSaturationLevel and according to it, progress bar gets filled
    [02:47:50] [Render thread/ERROR] [de.ke.fa.cu.pl.pl.ad.CalculatorPlaceholder/]: [FANCYMENU] Failed to parse Calculator placeholder: {"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"nbt_data_get","values":{"source_type":"entity","entity_selector":"@s","block_pos":"","nbt_path":"foodSaturationLevel","scale":"1.0","return_type":"value"}}"}}
  3. yes
  4. yes
  5. can't see any typos, double-check them too
#

@broken cliff