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

Hello again,

 

So..... I'm back again unfortunately having to ask for more help converting over to Forge. This time however, it is with my interact!

 

I have noticed that I get either "ticking entity" errors or a NullPointerException error when anything calls the interact function. More specifically, when I right click on my entities. Most of the items in the interact function either tames the entities, or swaps them with a different entity(evolving). So..My logical guess is that something on the server side is not compatible with my code, but I do not have enough knowledge to really know what exactly that might be.

 

 

Here's my interact code:

 

 

public boolean interact(EntityPlayer entityplayer)
    {
    	
    	
    	
        ItemStack itemstack = entityplayer.inventory.getCurrentItem();

        if (readyToTame)
        {
            tame(entityplayer);
            return true;
        }

        if (itemstack == null && isTamed())
        {
            sitting = !sitting;
            motionY = 0;
            motionX = 0;
            motionZ = 0;
            return true;
        }

          if(itemstack!=null && itemstack.itemID == digimobs.xros.shiftedIndex)
        {
            itemstack = null;
            return false;
        }
        
        if (itemstack!=null && itemstack.itemID == digimobs.digirope.shiftedIndex)
        {
            itemstack = null;
            return false;
        }
        
        
        if (itemstack!=null && itemstack.itemID == digimobs.digivice.shiftedIndex)
        {	itemstack = null;
        	tame(entityplayer);
            return true;
        }
        

        if (isTamed() && itemstack.itemID == digimobs.data.shiftedIndex)
        {
        	switch(itemstack.getItemDamage()){
        	case 3:exp+=45;
        	case 2:exp+=35;
        	case 1:exp+=15;
        	case 0:exp+=10;
        	}
            entityplayer.inventory.consumeInventoryItem(itemstack.itemID);
            return true;
        }

        if (itemstack!=null && itemstack.getItem().shiftedIndex == digimobs.acorn.shiftedIndex
                ||itemstack!=null && itemstack.getItem().shiftedIndex == digimobs.acorn.shiftedIndex)
        {
            heal(;
            //if((int)hunger!=(int)getMaxHunger() && itemstack!=null && itemstack.getItem() instanceof ItemFood)hunger+=2;
            /*
             * worldObj.playSoundAtEntity( this, "sound.secret", 0.6F,
             * ((rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F) / 0.8F);
             */
            worldObj.spawnParticle("heart", posX, posY + height, posZ, 0,
                    0, 0);
            entityplayer.inventory.consumeInventoryItem(itemstack.itemID);
            return true;
        }

        if (isEvolveItem(itemstack) && isTamed())
        {
            evolve();
            //DigimonSaveHandler.saveDigimon(this);
            return true;
        }

        if (isTamed())
        {
            sitting = !sitting;
            motionY = 0;
            motionX = 0;
            motionZ = 0;
        }

        return super.interact(entityplayer);
        
    }

 

 

Thanks for any insight you may be able to provide! :)

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.