#Initializing Legacy Material Support issue
1 messages · Page 1 of 1 (latest)
name: MyFirstPlugin
version: '${project.version}'
main: me.ihsan.myfirstplugin.MyFirstPlugin
api-version: 1.17
authors: [ ihsan ]
description: My first plugin
commands:
die:
description: Simple way to attempt suicide.
usage: /<command>
aliases:
- suicide
- killme
about:
description: About the server.
usage: /<command>
aliases:
- info
- server
tpa:
description: Send a teleport request to a player.
usage: /<command> <player>
fly:
description: Get ability to fly. Only for operators.
usage: /<command>
tpaccept:
description: Accept teleport request.
tpdeny:
description: Deny teleport request.
menu:
description: Opens menu.
usage: /<command>
Does it do it if you change your version to something like 1.0.0 instead of '{$project.version}'
1.0.0
ok ill check
btw can you check if tehre is any problem in the class where i make the gui
package me.ihsan.myfirstplugin.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public class VaultCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof Player player) {
Inventory menu = Bukkit.createInventory(null, 27, "Menu");
ItemStack survival = new ItemStack(Material.IRON_SWORD);
ItemMeta survivalMeta = survival.getItemMeta();
survivalMeta.setDisplayName(ChatColor.BLUE + "Game Mode");
survival.setItemMeta(survivalMeta);
menu.setItem(11, survival);
player.openInventory(menu);
return true;
}
return false;
}
}
Looks fine
Send plugin.yml again
name: MyFirstPlugin
version: 1.0.0
main: me.ihsan.myfirstplugin.MyFirstPlugin
api-version: 1.17
authors: [ ihsan ]
description: My first plugin
commands:
die:
description: Simple way to attempt suicide.
usage: /<command>
aliases:
- suicide
- killme
about:
description: About the server.
usage: /<command>
aliases:
- info
- server
tpa:
description: Send a teleport request to a player.
usage: /<command> <player>
fly:
description: Get ability to fly. Only for operators.
usage: /<command>
tpaccept:
description: Accept teleport request.
tpdeny:
description: Deny teleport request.
menu:
description: Opens menu.
usage: /<command>
also I found something in the forum
here the dude says he got the error when Inventory::adItem command
is it related or something?
I used Inventory.setitem ithink
It shouldn't, I wouldn't think
but then how!?
If you comment it out does it still do it?
ok let me see
omg I think i finally fixed it
The error was not the setitem
it was the system.out.printline
I used itemstack.getdata.getitemtype instead of itemstack.gettype()
Ah