Forum rules: Do not post bugs or feature requests here! Report bugs to our Issue Tracker and suggestions to Suggest a Feature.

This site is not for solicitation of services or 'purchasing' development. Please do not post requesting side mods/plugins and so on. Your thread will be removed, and you will receive a warning.
User avatar
By JamieS1211
#126282 Ok so long story short I need to disable the placing of trade machines. I isolated the id 4084 as the id for the main trade machine block and so tried to blacklist that item in both essentials and WorldGuard. After this did not work I did some custom java code to prevent the placement of traders via the use the ID 4084 (I also added the ID 91 Jacko lanterns to test if the placing was prevented). I was wondering if anyone could tell me what ID I need to block. I have also pasted the relevant code (without imports) below.


Custom code of plugin. This does prevent players placing the lanturns successfully.
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
List<Integer> NoPlace = Arrays.asList(91,4084);
if (event.getBlockPlaced() == null)
return;
if (NoPlace.contains(event.getBlockPlaced().getTypeId()))
{
event.setCancelled(true);
}
}

By Rephox
#126421 One of the ways to check the id you need is to go in game and use f3 and h at the same time. You can then hover over the item and it will tell you the id over its name. The other way is to look in the config. Minecraft by default adds some numbers to it. I cant remember what that number was exactly so the best answer from me would be the f3 h. I hope this suits your needs!

~Rehpox
User avatar
By JamieS1211
#126441 I have this turned on all the time, the problem with this is that in your inventory items such as traders or more vanila type items such as lets say redstone or item frames are items when in your inventory however when placed they are blocks. Hence using the above method you get the item ID (redstone = 331) where as to block placing the item you need the block id (redstone = 55). Unfortunately here I have blocked both item ID and block ID however no luck in the prevention of placement however using the same IDs just on a break event players are unable to break traders.
By Rephox
#126459 Ahh thats right! They are item blocks! Well add 256 to what ever id's are in the configuration file. Thats the number XDD. The trademachine block id is 4084 so add 256 to it and you got 4340. I hope I helped!

~Rehpox
User avatar
By JamieS1211
#126524 alas it did not work :(
Its weird how the place ID and break ID is different. as 4084 works for preventing placement.
User avatar
By STALKGAMING
#126544 not sure whats up but i had made a creative world on my server and blocked a few things in WorldGuard like traders, rare candys and a few other things and it seems to have worked fine. Make sure you are blocking it in the right world other than that i'm not sure unless a plugin is blocking WorldGuard from blocking it
User avatar
By JamieS1211
#126574 Can you send me the ID's you used in the blacklist of worldguard files. I only use one world or pixelmon won't spawn in the others. Because this method didn't work for me I coded one myself.
User avatar
By KuroMakai
#126752 Did some research for you. The Trade Machine is #10272 for it's inventory ID and it's block id is Trade Machine. So if you wish to ban all trading machines, blacklist both 10272 and Trade Machine for your required IDs.
User avatar
By JamieS1211
#126756 I already tried blocking 10272 with no effect and even tho "Trade Machine" isn't an idea I put it in but placement of traders is still allowed
JOIN THE TEAM