-
How to assign commands to an item?
This ended up being what works public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ChunkCoordinates bed = par3EntityPlayer.getBedLocation(par3EntityPlayer.dimension); if(bed == null) { bed = par3EntityPlayer.worldObj.getSpawnPoint(); } par3EntityPlayer.setPositionAndUpdate(bed.posX, bed.posY, bed.posZ); return par1ItemStack; }
-
getBedLocation() not working
This fixed it ChunkCoordinates bed = par3EntityPlayer.getBedLocation(par3EntityPlayer.dimension); par3EntityPlayer.setPositionAndUpdate(bed.posX, bed.posY, bed.posZ); return par1ItemStack;
-
getBedLocation() not working
That didn't work, but it completely obliterated the area around my original spawn
-
getBedLocation() not working
I made an item that is supposed to teleport me to my bed location using getBedLocation() but instead it keeps teleporting me to my original spawn point. Anyone know how to fix this? Here's the complete class file
-
How to assign commands to an item?
Yes, it is imported. The reason it's in "food" is because that's where the other "Crystals" are. One crystal heals you, one crystal is an antidote like milk, and this one is supposed to teleport you. None are really food but the other two are treated like it so I put this one in the same package with those. It's supposed to be based off the Anime, Sword Art Online (SAO). My little brother is obsessed with it so I am making this for him.
-
How to assign commands to an item?
There's an error on "new TeleportCrystalClass()" because it's "Undefined". I'm guessing that means it needs the "int par1" from my class file? I'm not sure what those are
-
How to assign commands to an item?
The start entity id was placed there by eclipse, not sure why. As for the rest of the code, I just copied it from an earlier reply suggesting what I should do. I'm trying to make an item that teleports me to my spawn point.
-
How to assign commands to an item?
The start entity ID was used to make a mob, but that's how the error corrector fixed it when I clicked it. I have about 15 other items with textures labeled the exact same way in this mod and they all work fine, so I don't think that's part of it Yes, I am developing for 1.7.2 Sorry for my lack of experience with code, but what would you recommend I put in "new TeleportCrystalClass()"?
-
how to use the "private boolean alwaysEdible;"
Thank you! I'm still learning java but have backgrounds with C#, PHP, and Python so some of it I understand but it's been a while
-
How to assign commands to an item?
Here is my complete Class File And this is what I currently have in my MainClass: public static Item TeleportCrystal = new TeleportCrystalClass(startEntityId).setUnlocalizedName("TeleportCrystal").setCreativeTab(saoTab); and regarding what you said about startEntityId, this is also in my main class. Would that change anything? private static int startEntityId = 300; public static int getUniqueEntityId() { do { startEntityId++; } while(EntityList.getStringFromID(startEntityId) != null ); return startEntityId++;
-
How to assign commands to an item?
I got rid of the error in my Main Class by making it new TeleportCrystalClass(startEntityId) but the error on super(par1); is still causing my game to crash
-
How to assign commands to an item?
I get two errors with this: on "super(par1)" that says "The constructor Item(int) is undefined" and another in my Main Class where I declared it, public static Item TeleportCrystal = new TeleportCrystalClass().setUnlocalizedName("TeleportCrystal").setCreativeTab(saoTab); the error is on "new TeleportCrystalClass()" and it says "The constructor TeleportCrystalClass() is undefined" Where did I go wrong?
-
how to use the "private boolean alwaysEdible;"
I can't figure out where exactly to put this in my food class file or what parameters. Could someone give an example of how to do it? I also need to change the itemUseDuration
-
How to assign commands to an item?
Could you give an example of what to put in the class file?
-
How to set which tools can break my block/ore?
THANK YOU! It worked perfectly
IPS spam blocked by CleanTalk.