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 have encountered a problem, I have made a new item and such and its all working fine and dandy but I cant seem to figure out how to make the spider follow you when you hold the new item. Does anyone know how I can make the spider follow me while holding my spider queen crown item? Can I use the [glow=blue,2,300]EntityAITempt[/glow] and make the vanilla spider follow me when I hold the crown in my hand. I have spent hours trying everything I can think of. I would prefer if you respond you can give some example code. And i [glow=red,2,300]don't want to edit the vanilla classes[/glow]. Can you help? Thanks soo much in advance!

I don't think you can use the tempt AI because I don't think spiders use the new AI.  You can check by printing out the returned value from the isAiEnabled() method.  Basically, some entities use the AI task list and others use the onUpdate() method to control them.  I think spiders use the latter.

 

In the case of an entity that uses onUpdate, you may be able to control it using the LivingUpdateEvent.  This is a cancelable event (meaning you can cancel the vanilla behavior and replace with your own).  So in that event you'd check if the event.entity was instanceof EntitySpider and if that is true then you'd check if the player is holding the item (that might be a bit tricky though as no player is returned in that event, so you'd want to look for EntityPlayer within a certain distance) and if so then you'd want to cancel the vanilla behavior and replace with your own.

 

The only issue is that you should copy a lot of the onUpdate() code to ensure that the behavior is still somewhat normal, and you'd want to implement proper pathfinding and such so that it moved properly.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Exactly as jabelar said, but if you wait for 1.8, one of the major points of the update was to get ALL of the entities using the AI system (it's shocking how many don't use it in 1.7, actually).

 

In the meantime, his solution is viable - I've done similar things in the past and they work fine.

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.