# issue with detecting blocks

## Recommended Posts

I'm going to say this:

Any person who can help me program this correctly will have their name on the credits of this mod for coding.

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

##### Share on other sites

I'm going to say this:

Any person who can help me program this correctly will have their name on the credits of this mod for coding.

You bumped this after, what, not even four minutes?

Anyway, what's wrong with Mew's code?

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

##### Share on other sites

It works to a point..... just that it makes the blocks like they are invisible non solids, but when you walk into them its like the player has a continuous, sand fall in place disorder.....

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

##### Share on other sites

im trying to code it for a 3X3X4 square this block being on the top row.

essentially 3 blocks below this plus the row its on

You have < 2 right now.  Which means it will do 0 and 1, but not 2.

Also, it's not centered on your pit trap.

```for(i=-1;i<=1;i++) {
for(j=-1;j<=1;j++) {
for(k=0;k<=3;k++ {```

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

DO NOT PM ME WITH PROBLEMS. No help will be given.

##### Share on other sites

where does that go?

...in place of your current loop..?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

DO NOT PM ME WITH PROBLEMS. No help will be given.

##### Share on other sites

how do you handle the x, y, and z variables?

seriously?

x+i

y-j

z+k

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

DO NOT PM ME WITH PROBLEMS. No help will be given.

##### Share on other sites

public class PitfallHandler

public World world; // the world you are using

public int i, j, k; // X, Y, and Z axis variables

public int x, y, z;

i had to add the last line for it to not error

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

##### Share on other sites

This is when I facepalm myself to death...

Can you tell we and/or show screenshots of the "null" blocks (blocks that are invisible and glitch the game. My name for 'em )?a

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there

##### Share on other sites

Upon further investigation, my code only errors when I take out the

this.world = world;

line......

Anybody have ideas?

package huntingTraps.Resources;

import net.minecraft.world.World;

public class PitfallHandler

public World world; // the world you are using

public int i, j, k; // X, Y, and Z axis variables

private int x, y, z;

public PitfallHandler(World world, int x, int y, int z)

{

this.world = world; // the world

this.x = i; // X axis

this.y = j; // Y axis

this.z = k; // Z axis

}

public void generatePitfall()

{

// this nested for loop will make a 'block' of air to the dimensions specified in numOfBlocksOn***

for(i=-1;i<=1;i++)

{

for(j=-1;j<=1;j++)

{

for(k=0;k<=3;k++)

{

//if(world.getBlockId(i+x, j-y, k+z) == Block.stone.blockID)

// {

world.setBlock(

i + x, // this makes blocks of air go out however many numOfBlocksOnXAxis was

j - y, // this makes blocks of air go out however many numOfBlocksOnYAxis was

k + z, // this makes blocks of air go out however many numOfBlocksOnZAxis was

00 // the block of air

);

//  }

}

}

}

}

}

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

##### Share on other sites

```public PitfallHandler(World world, int x, int y, int z)
{
this.world = world; // the world
this.x = i; // X axis
this.y = j; // Y axis
this.z = k; // Z axis
}
```

to this:

```public PitfallHandler(World world, int x, int y, int z)
{
this.world = world; // the world
this.x = x; // X axis
this.y = y; // Y axis
this.z = z; // Z axis
}
```

because at the moment you are still using null variables. but only with the location variables. the world variable is correct though

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there

##### Share on other sites

I wouldn't mind if it even showed any indication of what it's even doing tho....... it does absolutely nothing now...no block change, no error, nothing....

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

##### Share on other sites

I wouldn't mind if it even showed any indication of what it's even doing tho....... it does absolutely nothing now...no block change, no error, nothing....

... what are you developing your code with? Eclipse alike many other IDEs come with a debugger. You should use that. It helps a lot finding out why your code doesn't work at all anymore.

##### Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

DO NOT PM ME WITH PROBLEMS. No help will be given.

##### Share on other sites

I don't even know if its the loop

My point is:

You need to learn the basics before you can mod minecraft.

By not understanding that you needed to replace one set of loops with another set of loops and how to convert the pseudocode I posted into actual code, you have demonstrated that you have no idea what your doing.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

DO NOT PM ME WITH PROBLEMS. No help will be given.

##### Share on other sites

I don't even know if its the loop

My point is:

You need to learn the basics before you can mod minecraft.

By not understanding that you needed to replace one set of loops with another set of loops and how to convert the pseudocode I posted into actual code, you have demonstrated that you have no idea what your doing.

^^^ Agreed...

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there

##### Share on other sites

naw, my brain has been dead for a day or so now cuz of this problem......I can't even talk straight to my friends at this point. leave me alone about the "basics"

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

##### Share on other sites

naw, my brain has been dead for a day or so now cuz of this problem......I can't even talk straight to my friends at this point. leave me alone about the "basics"

Okay. (Sorry about that, had a run in with a teacher at school ) Do you have your source code anywhere? That way we can help a lot more. Can I see your Block code (where you activate the trap), and your current Pitfall generator?

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there

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

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×

• ### Posts

• Why are you creating duplicate threads? https://forums.minecraftforge.net/topic/122342-i-cant-get-information-out-of-crash-report/#comment-532898
• Not sure if this help, because I am not familiar with what you are talking about.   The release notes for 1.19.3 explains the configuration file for where minecraft looks to populate each atlas. Search for atlas here: https://www.minecraft.net/en-us/article/minecraft-java-edition-1-19-3   This is the most recent default/vanilla configuration of the block atlas texture locations: https://github.com/misode/mcmeta/blob/assets/assets/minecraft/atlases/blocks.json
• Thing is, in my cit/item folder i used to have seperate folders for every item i changed, not only to easily find them again when needed but also because some of the items i changed by name are the same base item like netherite tools for example. This change basically made it impossible to have multiple textures named for 1 item due to not being able to have the same named .properties files in the same location. Unless there will be a modded support for it like optifine or CIT resewn or any of the other CIT mods could allow for files to be read beyond just the cit/item and then your image and properties files. What i have (and maybe loads of other people do to is assets/optifine/cit/item/(name of item changed) and then the properties and image files. I don't know about all of this for sure i made this conclusion after some testing i did but to me this appears to be the problem, i'd really like to be proven wrong on this to be honest. Otherwise we'd have to wait for CIT mods to update to read more files than minecraft its-self allows.
• Not true. Use the latest preview release of optifine (currently pre3)

• ### Who's Online (See full list)

×

• #### Activity

×
• Create New...