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

I want to add a task to the pig that will make the pig follow the player, regardless of what is held. Maybe i could make it my pet? Although i'm not sure how to do that. Any help is appreciated. Thanks!

Check out the wolf code.

if (user.hasKnowledgeOfJava) {

    if (user.question.hasCode) {

        return interpetHelpfulResponse(user.getQuestion());

    } else {

        return "Could you post your code please?";

    }

} else {

    return "Learn some freaking Java!";

}

All the code you need is in any of the passive mobs that can be tamed (all of which extend EntityTameable). As suggested, if you look in EntityWolf and EntityTameable, you can find the code you need.

 

You will not be able to easily make the vanilla pig tameable, but you can make a class that extends EntityPig and replace the vanilla pig with your custom pig when you 'tame' the pig.

  • Author

Ok thanks for clearing that up. :) Is there a way, though, for it to just follow me by either setting it's path? I tried but I got a null error. Same if I try to just set it's position to about mine. It doesn't have to be a pet or anything. I also tried setting its path to entity? Sorry not at my computer now but it took an entity creature and I'm not sure if you can cast entity player into that.

I've wanted to do something similar to this and I thought maybe I could make the mob target the player without hurting him? Also if anyone could figure out the piece of code that has a baby animal follow it's parent that might work too?

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.