#(SeorOreo) event related to consuming an item

25 messages · Page 1 of 1 (latest)

spiral veldt
#

Is it possible for a player to consume an item without being hungry? Like the golden apple, for example, it can be eaten without feeling hungry, I would like to copy this mechanism

hasty tuskBOT
#

(SeorOreo) event related to consuming an item

hasty tuskBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

alpine crescent
#

If the player isn't hungry you can't eat. But you could make the player hungry, when they right click with a food item, to let them eat it and set the food level back to normal afterwards or leave it as is.

#

!e clicks block

acoustic adderBOT
# alpine crescent !e clicks block
Group

Player

**WARNING**

this event may in some cases double-fire, requiring usage of the 'ratelimit' command (like 'ratelimit <player> 1t') to prevent doubling actions.

Event Lines

player (right|left) clicks <block>

Switches

with:<item> to only process the event if a specified item was held.
using:hand/off_hand/either_hand to only process the event if the specified hand was used to click.
type:<material> to only run if the block clicked matches the material input.

Triggers

when a player clicks on a block or in the air.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.item> returns the ItemTag the player is clicking with.
<context.location> returns the LocationTag the player is clicking on.
<context.relative> returns a LocationTag of the air block in front of the clicked block.
<context.click_type> returns an ElementTag of the Spigot API click type <@link url https://hub.spi...
<context.hand> returns an ElementTag of the used hand.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

coarse iris
#

You could add fake hunger to that ^, so that it seems like they're full when they're actually not

#

!m PlayerTag.fake_health

acoustic adderBOT
# coarse iris !m PlayerTag.fake_health

Shows the player a fake health bar, with a number between 0 and 20, where 1 is half of a heart.
Use with no input value to reset to the player's normal health.
Optionally, you can specify a fake food level, between 0 and 20.
You can also optionally specify a food saturation level between 0 and 10.
For example:

  • adjust <player> fake_health:1
  • adjust <player> fake_health:10|15
  • adjust <player> fake_health:<player.health>|3|0
Object

PlayerTag

Input

ElementTag(Decimal)(|ElementTag(Number)(|ElementTag(Decimal)))

alpine crescent
#

That name is weirdly misleading

coarse iris
#

Yeah, definitely lol

spiral veldt
# acoustic adder

oh ok I thought there was a property for the items that made them able to be consumed at any time.
For the fake food level it would be something like

  • adjust <player> fake_food_level:0 right?
alpine crescent
#

No it's currently fake_health, not fake_food_level

spiral veldt
#

And how do I specify the level of food?
ohhh there the input has 3 values I imagine that the second value is related to the level of hunger

#

It would be good if they changed the name of the mechanism, the truth is that it is very misleading hahaha 🤭

alpine crescent
#

That should probably take a map input.

spiral veldt
#

yeah I think the same would be better something like:

- adjust <player> fake_stats:<map[health=20;food_level=20;food_saturation=20]>```