Posted September 1, 20169 yr Hi All, I'm trying to create a mod for use in Redstone puzzle maps where players can use a block that activates a door and clears their inventory. I am completely at a loss on how to do this. I've been looking throughout the internet and haven't found anything. If any of you have any resources on this I'd appreciate it.
September 1, 20169 yr Hi All, I'm trying to create a mod for use in Redstone puzzle maps where players can use a block that activates a door and clears their inventory. I am completely at a loss on how to do this. I've been looking throughout the internet and haven't found anything. If any of you have any resources on this I'd appreciate it. Well first you need the a player variable, and once you have one call player.inventory.clear() 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.
September 2, 20169 yr Author "Well first you need the a player variable" Sorry, but I'm not sure how to do this. Does this involve messing with NBT commands?
September 2, 20169 yr "Well first you need the a player variable" Sorry, but I'm not sure how to do this. Does this involve messing with NBT commands? No it does not how do you want the player to clear there inventory? 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.
September 2, 20169 yr How do you want the player to interact with the block? Right click it? Step on it? There are method's in the Block class, and more, that will give you the player variable when he/she interacts with your block. The methods for the mentioned interactions are onBlockClicked & onEntityCollidedWithBlock . Be sure to cast the Entity given from the latter, to Player . Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
September 2, 20169 yr Be sure to check types before casting. 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. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.