Posted August 5, 20205 yr Hi, is there a way to understand if an item is a crop? (plantable on a farmland)
August 5, 20205 yr I think yes i mean probably use a boolean with instanceof BlockNamedItem it should work altough i'm not sure if the BlockNamedItem class is only used for plantables but it should work!
August 5, 20205 yr Author 1 minute ago, Crazzy4999 said: I think yes i mean probably use a boolean with instanceof BlockNamedItem it should work altough i'm not sure if the BlockNamedItem class is only used for plantables but it should work! Some crops have no seed in the name
August 5, 20205 yr XD that's doesn't mean that the code isn't almost the same bruuuh the potato and wheat seed item extends to the same class
August 5, 20205 yr Author 3 minutes ago, Crazzy4999 said: XD, ciò non significa che il codice non sia quasi lo stesso bruuuh che l'elemento di seme di patata e grano si estende alla stessa classe Also for modded seed?
August 5, 20205 yr Not really i mean it's just a class you know what i'm saying basically there is no seed at all just a class but anyway what are you trying to do? i might can help you
August 5, 20205 yr Author 1 minute ago, Crazzy4999 said: Not really i mean it's just a class you know what i'm saying basically there is no seed at all just a class but anyway what are you trying to do? i might can help you A bonsai pot mod for crops
August 5, 20205 yr For only crops? if so you can check when you right click the bonsai pot if the item the player currently holding is an instanceof BlockNamedItem if so you can plant it if not than it will not let you i guess this is the concept right?
August 5, 20205 yr You can't guarantee that other mods inherits from vanilla classes, I'll say use tags Edited August 5, 20205 yr by poopoodice
August 5, 20205 yr Yeah of course not but i told he/she wants to make the bonsai pot for only vanilla or for his/her mod but if he/she wants to be compatible with other mods tags are the way to go
August 5, 20205 yr Author 1 hour ago, poopoodice said: You can't guarantee that other mods inherits from vanilla classes, I'll say use tags Not every crops have the right tags
August 6, 20205 yr Author 21 hours ago, diesieben07 said: The correct way is to check if the Block implements IPlantable. If it does, and IPlantable#getPlantType returns CROP then it can be planted on farmland. But I can't execute it on an existing block in the world I have to execute it on an item
August 6, 20205 yr And not all things that plant crops are items that are BlockItems. 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.