Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(1.16.5/1.16.4) How can I create a interactable vending machine?

Featured Replies

Posted

Hello everyone! A few days ago someone asked for a working vending machine in my mod, but I don't know how I do that. my vending machine is now only decoration but I want it to be interactable. Like a real vending machine. I have custom money in my mod that I want to use in the vending machine.

 

 

I also don't know how to get a vending machine hitbox 2 blocks high. only on the bottom side the hitbox is 2 blocks high, but on the upper part there's nothing. I can even place something there. I have uploaded my vending machine class here. (I've seen that I need a "vending_machine_upper" block but I don't know what I need to do with that.)

vending machine.png

class1.png

class2.png

Edited by GhostGamesFSM

  • Author
5 minutes ago, diesieben07 said:

You cannot make a block that is larger than 1x1x1. If you want to, you need to use multiple blocks. Look at the Minecraft door or double plants for examples.

Thanks, I'm going to look at the models of the double plants.

Never post code as screenshots, that is probably the #1 worst way to share it (maybe besides a video).

Best way is to create a github, and post your project on there, then share a link here.

If you're just sharing a small portion, copy & paste directly to your forum post inside code tags (the < > button at the top of the composition part of the screen)

Edited by Ugdhar

  • Author
31 minutes ago, Ugdhar said:

Never post code as screenshots, that is probably the #1 worst way to share it (maybe besides a video).

Best way is to create a github, and post your project on there, then share a link here.

If you're just sharing a small portion, copy & paste directly to your forum post inside code tags (the < > button at the top of the composition part of the 

https://github.com/GhostgamesDHG/MinetopiaMod/blob/master/src/main/java/com/ghostgamesdhg/minetopia/blocks/Vending_Machine.java

 

Here's the code on github. Thank you for the reaction.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.