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

Hey, I'm Schilcote, and I'm just getting started with Forge/Minecraft modding (I dabbled in it a little bit a long time ago, but didn't learn much).

 

I need a few pointers on where to get started with my first mod. I've got the basics down- I know how to make an item and a block, and I somewhat understand the idea of these sided proxy thingies, so now I'm getting down into mechanics code.

 

The first thing I need advice as to how to do is this: I have an item that I want to drop once the player breaks his 1024th stone block. I need it to spawn exactly once. How would I go about this?

Listen for PlayerEvent.HarvestCheck, make sure the block is Stone, and save the number...somewhere...would probably be the easier.

I'm not familiar with saving data to player's, but it can probably be done.

new EntityItem(event.entityPlayer.worldObj,event.entityPlayer.posX,event.entityPlayer.posY, event.entityPlayer.posZ, new ItemStack(IDHERE,1));

  • Author

Ah, that makes sense. Surprisingly straight-forward. Lemme try writing some code now...

 

EDIT:

 

Though I'm 99.9% sure you can't just stick fields on things willy-nilly like you can in Python. So how would I store this information?

That's what I was just trying to figure out...

You could either store to a config file, which I guess would work but would be ugly, or maybe save to player data, which I don't know how to do =/

Made some mock up code, and couple of problems:

1)HarvestCheck is apparently called a lot. Like, every time out click on it. Also, only called when you try to harvest without a tool, which is odd.

2)HashMap wouldn't work, since you still need to be able to save inbetween server restarts.

  • Author

Huh.

 

Well, I think we ought to wait for someone who knows how to do these sort of things to show up, then. :P

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.