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 there!

 

So I have this TE that teleports the items above them to another location... for testing purposes I have it set so that it will move 5 blocks up realitive to the TE.. however it seems to send the items hundreds of blocks away, instead of 5 above.. Any fix?

 

Here is the code:

    @Override
    public void updateEntity() {
        if (!world.isRemote) {
            itemsAbove = this.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-1, this.pos.getY(), this.pos.getZ() -1, this.pos.getX() + 1, this.pos.getY() + 2, this.pos.getZ() + 1));
            if(!this.isRedstonePowered && !this.isPulseMode) {
                this.doWork();
            }
        }
    }

    public void doWork() {
        if(itemsAbove.size() != 0) {
            for(EntityItem item : itemsAbove) {
                item.move(MoverType.PLAYER, this.pos.getX(),this.pos.getY()+1,this.pos.getZ());
                System.out.println(item.getPosition());
                System.out.println("Send Items!");
            }
        }else {
            return;
        }
    }

Relatively new to modding.

Currently developing:

https://github.com/LambdaXV/DynamicGenerators

Okay, can someone tell me why:

this.pos.getX() + "," + this.pos.getY()+5 + "," + this.pos.getZ()

 

and original pos being :

19,64,256

 

equals:

 

19,635,256

Do you know the definition of the word move? Look at the method you are using.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Oh, yeah thought that would just move the entity to coords...

 

Sorry about that!

 

However, trying to use this:

                player.setLocationAndAngles(this.pos.getX(), this.pos.getY() + 5, this.pos.getZ(), player.cameraYaw, player.cameraPitch);

 

Doesn't seem to do it either :/

 

Wait I realized I change the subject, I'm trying to move the player right now.

Relatively new to modding.

Currently developing:

https://github.com/LambdaXV/DynamicGenerators

Oh, yeah thought that would just move the entity to coords...

 

Sorry about that!

 

However, trying to use this:

                player.setLocationAndAngles(this.pos.getX(), this.pos.getY() + 5, this.pos.getZ(), player.cameraYaw, player.cameraPitch);

 

Doesn't seem to do it either :/

 

Wait I realized I change the subject, I'm trying to move the player right now.

Look at the teleport command, you will need to do what it does to move the player.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

okay, will repilcate it however, I'm still having an issue with the realitive positioning..

 

orginal coords

19,64,256

 

plus:

this.pos.getX(), this.pos.getY()+5d,  this.pos.getZ()

 

equals:

20,635.0,256

 

This is where I'm confused though.

Relatively new to modding.

Currently developing:

https://github.com/LambdaXV/DynamicGenerators

  • Author

Jesus, the teleport command is so hard to recompile with all the unlabeled parameters.

 

However, I was able to dig this out of there:

                        ((EntityPlayerMP)entity).connection.setPlayerLocation(entity1.posX, entity1.posY, entity1.posZ, entity1.rotationYaw, entity1.rotationPitch);

 

Which seemed to work!

 

However, for some reason, my TEs now need a block update to start ticking again :/

 

Thanks for your help!

 

Relatively new to modding.

Currently developing:

https://github.com/LambdaXV/DynamicGenerators

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.