- 30 May 2014 18:03
#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);
}
}
Minecraft username - Jamies1211
Minecraft username -SpreadSheetGuy
Twitch username - Jamies1211