Jump to content

[1.7.2][Solved]Getting all items and checking if player is in void?


Recommended Posts

Posted

How would I get all items "alive?" I need to check if there are items in the void, then get item info and do stuff with it, but I do not know how to get all EntityItems in the world. I tried this code, but it did not work:

TickListner(Method 1):

 

  Reveal hidden contents

 

TickListner(Method 2):

 

  Reveal hidden contents

 

I am also having trouble with checking if the player has fallen into the void, it is the same code(In method 2) It is giving me the achievement but not teleporting me.

Posted

  if (e.entityItem.dimension == VoidMod.NullVoidDimID)

 

Why are you checking the dimension? The item you need would be in the world where it created...

and you have to edit the teleporting code if you want to teleport the player.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

First how are you getting sent to your dimension.

Second

 p = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(pls);

should be

         p = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(pls[i]);

.

Third

 if (itemDropped.getEntityItem().getItem().equals(VoidMod.nullVoidAlloy))

should be

 if (itemDropped.getEntityItem().getItem() instanceof ItemNullVoidAlloy))

Posted

I do not know why in the code I posted it says str, in my actual code it says str. Also, I have found that equals works in another case. My problem is that it is not recognizing it is in the void. Also I have a block that teleports you into my dimension, but my code is not able to recognize any item past y level 0, which is what I want to do.

Code:

TickListner:

 

  Reveal hidden contents

 

Posted

2 things.

 

1) Have you registered your TickListener in your main class?

2) If you are trying to send an entity to the NullVoid dimension after they fall down, you don't check IF that are at the dimension you need to frickin' SEND them to the dimension.

Posted

The tick listener is registered in both event bus things, and I am trying to teleport the item to x 256 in the dimension if they are in the dimension and under y 0. I have a separate method for getting in the dimension. I think I have a problem with getting the world, because there are no entries in world.loadedEntityList and the player one is detecting properly.

Posted

Ok then. I just solved it by looping through all the worlds in MinecraftServer.getServer().worldServers and using those.

TickListner:

 

  Reveal hidden contents

 

Posted

Ok, I edited to your comments, but I need to set the player's gamma to one previously set, and I want to to retain across minecraft closings. How would I do that? I think packets but I do not know how to use them at all. Thanks for helping me fix my code :).

Revised TickListner:

 

  Reveal hidden contents

 

Posted

Ok, Thanks.

I am trying to change the player's gamma to -1F when they enter a dimension and revert it to their previous gamma when they exit. I already have it saving their gamma somewhere else, but I also need to revert it and make sure it is enforced if something does not work.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.