Data Packs Other

working vending maschine

  • 623 views 1 today
  • save_alt 47 downloads
Compatibility
Minecraft 1.21
to version
Minecraft 26.2
Changes include
    • 3
    • 4
    • 8
    1234lars
    Lvl 4Apprentice Miner
    1
    working vending maschine use /function example:summon to summon the vending maschine ,must be in a comand block



    how to install :youtu.be/CK0O7GZoEbM

    1 Update Logs

    Update #1 : by 1234lars 10/04/2025 2:29:21 pmOctober 4, 2025 @ 6:29 pm UTC

    added change money while paying and selector

    More like this

      Have something to say?

    Alexa_Version_1
    11/16/2025 6:01 am
    Level 1 : New Miner
    can you delete the vending machine from the ground
    1
    1234lars
    11/16/2025 9:21 am
    Level 4 : Apprentice Miner
    Yes with /function example:despawn
    1
    tollcraft
    10/05/2025 5:00 am
    He/Him • Level 50 : Grandmaster Steve Demolitionist
    Erm nice one for the first timer!
    Welcome to PMC buddy
    2
    1234lars
    10/05/2025 5:26 am
    Level 4 : Apprentice Miner
    thanks
    1
    Rodrigues
    10/04/2025 12:28 pm
    Level 16 : Journeyman Miner
    history
    Its okay...
    Ive changed the pay.mcfunction:

    # 1. Remove the clicked interaction entity
    execute as @e[​type=interaction,tag=pay] on target run execute as @e[​type=interaction] run data remove entity @s interaction

    # 2. Only continue if player is holding gold nuggets in mainhand
    execute at @n[​tag=pay] run execute as @p if data entity @s SelectedItem{id:"minecraft:gold_nugget"} run function example:pay_mainhand_check

    and added a pay_mainhand_check function:

    # 1. Count how many nuggets the player has in MAINHAND only
    # (clear 0 counts items without removing them)
    execute at @n[​tag=pay] run execute as @p store result score @s goldCount run clear @s minecraft:gold_nugget 0

    # 2. If they have ≥5 nuggets, set paid = 1
    execute at @n[​tag=pay] run execute as @p if score @s goldCount matches 5.. run scoreboard players set paid paid 1

    # 3. If they have ≥5 nuggets, remove exactly 5
    execute at @n[​tag=pay] run execute as @p if score @s goldCount matches 5.. run clear @s minecraft:gold_nugget 5
    2
    1234lars
    10/04/2025 1:11 pm
    Level 4 : Apprentice Miner
    good idea i'm probably gona add this to the data pack
    3
    1234lars
    10/04/2025 6:26 am
    Level 4 : Apprentice Miner
    Please comment what you think
    2
    1234lars
    10/04/2025 6:10 am
    Level 4 : Apprentice Miner
    Fixed a bug where option 2 didn’t work and you didn’t need to pay
    2

    Welcome