Posted January 9, 20223 yr I'd like to modify a tag when a block is (not just a block within my mod - ie vanilla block, other mod blocks, etc) I'm still digging through the codebase but I'm new to Forge modding so was hoping for a pointer or two on what I should look into. Happy to do the research, just looking for a little guidance if possible. Specifically, I'm using an item on a block: code example below (also I assume I'll need to use level.setBlock once modified) @Override public InteractionResult useOn(UseOnContext context) { // This will get me the tags on the block... // context.getLevel().getBlockState(context.getClickedPos()).getTags(); }
January 9, 20223 yr Author ah, ok so I’d need another approach. Overall goal would be to click any block with an item and do two things - consume item (which I can do) and mark that block as non spawnable. It seems like I’ll have to just use a set, or map and keep track of these separately… unless there’s someway to “wrap” every block at registration time with a new blockstate that includes an added property but that didn’t seem possible either not the right approach to me naïvely Edited January 9, 20223 yr by DasHutch clarified language
January 9, 20223 yr Author just that particular block position (and any additional block positions that are clicked with the same item) Edited January 9, 20223 yr by DasHutch clarity
January 9, 20223 yr Author Ah, ok so I’ll dig into capabilities. Thank you so much for the assistance! looking forward to learning more about these systems today and seeing where I end up. Have a great day!
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.