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.

Featured Replies

Posted

Hi, I need to know how to make an item play a song with noteblock sounds, when you use it (Right click). I also need to know how to make it select a song from a GUI, opened by shift+right clicking with the item. Could anyone help me please?

The flying banana ate my dog.

Hi, I need to know how to make an item play a song with noteblock sounds, when you use it (Right click).

playing one note: BlockNote.java, method "onBlockEventReceived".  so something like

par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "note.harp", 3.0F, var7);

where par2-par4 you would use coordinates of a player (posX..posZ). when item is right-clicked method "onItemRightClick" is triggered, there will be probably part of your code. test for shift - "player.isSneaking()". the music playing would be probably handled in tick handler (of a server?), where it would remember how much ticks passed from start of a song and when it's next note's turn it would call playSoundEffect on a position of a saved player (!more players can play a song at the same time!). [basic item creation: http://www.minecraftforge.net/wiki/Basic_Items]

 

I also need to know how to make it select a song from a GUI, opened by shift+right clicking with the item.

you'll need to learn how to create GUI and how to use custom packets to keep it in sync with server:

http://www.minecraftforge.net/wiki/Containers_and_GUIs

http://www.minecraftforge.net/wiki/Packet_Handling

selected song would be probably saved in ItemStack or just in item damage.

 

this text may not be complete/exact, but it should show you a possible way of doing it (I hope :D).

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

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.