[PLUG-408] Material of new 1.16 blocks being read as "AIR" Created: 05/Jul/20  Updated: 05/Jul/20  Resolved: 05/Jul/20

Status: Resolved
Project: SpigotPlugins
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Matthew Albert Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.16.1, Material
Environment:

Tested on Ubuntu 18.04 and Windows 10.

Currently building a plugin using the new blocks.

The code for command used to print the Material is as follows:

 

public class MaterialInHandCommand implements CommandExecutor {
 public Beam plugin;
 public MaterialInHandCommand(Beam plugin){
 this.plugin = plugin;
 this.plugin.getCommand("materialinhand").setExecutor(this);
 }

 @Override
 public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
 if(!(commandSender instanceof Player)){
 commandSender.sendMessage("Only players can execute this command");
 return true;
 }
 Player p = (Player) commandSender;
 p.sendMessage(p.getInventory().getItemInMainHand().getType().name());

 return false;
 }
}

 


Attachments: PNG File image-2020-07-04-21-45-15-437.png     PNG File image-2020-07-04-21-45-44-560.png     PNG File image-2020-07-04-21-46-09-887.png     PNG File image-2020-07-04-21-46-29-708.png     PNG File image-2020-07-04-21-46-58-894.png     PNG File image-2020-07-04-21-47-27-791.png     PNG File image-2020-07-04-21-47-52-986.png    
Version: git-Spigot-ccb012a-567e245 (MC:1.16.1)
Plugin: My Own WIP Plugin
Guidelines Read: Yes

 Description   

Hello, I am currently building a plugin using the new 1.16 blocks.

However, it is reading all the new blocks as "AIR" instead of what is in the JavaDoc

My plugin runs the following to produce the output in chat

p.sendMessage(p.getInventory().getItemInMainHand().getType().name());

I've mixed pictures of it behaving normally with older blocks and with the 1.16 blocks.

This seems to be occurring with all 1.16 items.



 Comments   
Comment by md_5 [ 05/Jul/20 ]

You did not define api-version as 1.13 or greater. You were warned about this in your logs.

Generated at Sat Dec 13 02:30:04 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.