#help-development
1 messages · Page 1423 of 1
ok so ```java
org.bukkit.inventory.meta.Damageable helmetdamagedam = ((org.bukkit.inventory.meta.Damageable) p.getInventory().getHelmet().getItemMeta());
helmetdamagedam.getDamage()
gets the damage but why dont items with damage have item meta?
how do i get the item meta from an item that has damage but no meta
there is no such item
the only item without item meta is air
and air is not damageable
in pre 1.13 it is a bit different
yeah that shit uses like damage values or some shit, dunno
Guys, just wondering, why doesn't my compiler give "method not used" warning on method with annotation @fresh templetHandler?
you can also manually tell your IDE not to give the warning if a method is annotated with a specific annotation
So how do you make a plugin compatible from 1.8 to 1.16.5? You just develop for 1.8 and hope for the foreward compatibility?
I was expecting something that does it automatically
XD
Do I need to write my own plugin for IntelliJ or it exists something more fast?
why
I just don't like warnings
just click the button?
you only need to do it once
or did you think you'd have to do it for every method individually
every method XD
dumb
I know
[21:33:52] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=16, y=11, z=-117} but found not block entity block Block{minecraft:stone} at location
[21:33:52] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:stone} but failed at location BlockPosition{x=16, y=11, z=-117}
[21:33:52] [Server thread/ERROR]: Block at 15, 11, -115 is Block{minecraft:stone} but has net.minecraft.server.v1_16_R3.TileEntityChest@772398c2. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
[21:33:52] [Server thread/ERROR]: Block at 15, 11, -115 is Block{minecraft:stone} but has net.minecraft.server.v1_16_R3.TileEntityChest@772398c2. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
[21:33:52] [Server thread/ERROR]: Block at 15, 11, -115 is Block{minecraft:stone} but has net.minecraft.server.v1_16_R3.TileEntityChest@772398c2. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
Anyone know why this is?
Code:
@EventHandler
public void chunkLoad(ChunkLoadEvent event){
if (!event.isNewChunk()) return;
Chunk chunk = event.getChunk();
for (int y = 0; y <= 150; y++) {
for (int x = 0; x <= 15; x++) {
for (int z = 0; z <= 15; z++) {
Block block = chunk.getBlock(x,y,z);
setBlockFast(block,Material.STONE);
}
}
}
}
public void setBlockFast(Block block, Material type) {
CraftBlock cb = (CraftBlock) block;
net.minecraft.server.v1_16_R3.Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();
IBlockData data = CraftMagicNumbers.getBlock(type).getBlockData();
chunk.getWorld().notify(cb.getPosition(), cb.getNMS(), data, 0);
chunk.setType(cb.getPosition(), data, false);
}
i feel like it is because they have not been set yet, therefore there is a placeholder block
However i am not familiar with world gen
how can i acces that chest var in a scheduler ?
that's a local variable
this works
it can only work if you use an atomic integer that way
is that the best way of doing it?
I'm going to make an arena joining sign for a minigame.
How can I see the exact spawn location of the sign here?
i know this is a stuip question xD
so
The sign is placed in the 2nd block. Can I find it by climbing above block 1, or can I find it by climbing above block 2?
piece.getItem().isSimilar(e.getNewArmorPiece())
for some reason this doesn't work
nope i dont wanna this way xD, i wanna coord
like X Y Z?
yeap
Can someone tell me whats wrong I get this error while trying to package my plugin using Intelij Maven Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ServerGlobal: Fatal error compiling
event.getblock.getlocation.getblockX
i think
event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.CHEST
Block b = event.getClickedBlock();
b.getLocation().getBlockX();
.
or just block b = event.getclickedblock.getlocation.getblockx
did you google it?
piece.getItem().isSimilar(e.getNewArmorPiece())
for some reason this doesn't work
Yes
uhh i managed to change name above player but i kinda have an issue
why is their name red there
Hey !
How is that possible ? xD
There's nothing to help me 😦
Are webhooks integrating with discord and Minecraft simple to use?
Or will that be confusing to figure out
The JVM is eating the exception
Read my message -_-
where
How the fuck is that possible xD
Basically try-catch everywhere, make sure to not use any JVM flags that can cause this
Additionally this exception might have been suppressed by the JVM because it got fired too often, in that case you would need to check whether it was thrown anytime prior
Oooh okay
@quiet ice you reckon you could help ill send code
The third cause is a plugin misbehaving (for example a plugin calling Syserr.println(ex.toString()))
Well wtf xDD
?paste
I am not experienced with brigadier, so no
could anyone help
this is my code: https://paste.md-5.net/geyavuxoke.cs
and this is happening
https://gitlab.com/Dymeth/physicscontrol
How get open source I try get from VCS but libary don't import ;/
?
did you try git clone https://gitlab.com/Dymeth/physicscontrol.git?
Alternatively, import to github (it supports cross-site repo migration) and clone from there
Alternatively, import to github (it supports cross-site repo migration) and clone from there
If I posted that twice, then sorry, discord is strange
I try https://gitlab.com/Dymeth/physicscontrol.git but with option "Get from VCS"
I do not have an idea on what you are talking about
Hey, by the way, I've found my error...
I've added something like 20 entries in my config file, but I didn't delete my last one 😦
nuke all .iml files
Or just ignore them
And that people, is why you should not commit IDE config files
[22:02:46] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=-98, y=20, z=-325} but found not block entity block Block{minecraft:stone} at location
[22:02:46] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:stone} but failed at location BlockPosition{x=-98, y=20, z=-325}
anyone know what this is?
I am setting blocks to stone
and i have dealt with the tile entities
however i still get an error with the Dummy block entities
you could use bukkit to handle blocks with the block entities instead of whatever you are using; even if it will be slower
bump
sorry, lemme post some code
this is mostly nms stuff, i didn't know there was a bukkit interface
oks
how can you share an array across two event classes? I want to store the blocks players place in an array that will be changed when an entity moves
Do you mean Classes or methods?
could anyone help
this is my code: https://paste.md-5.net/geyavuxoke.cs
and this is happening
Pass that array through both of their constructors.
why are you changing the player's name
im chaing the name above their head
it works
it just does that though
and i dont rlly like it
that's gonna cause a lot of issues with other plugins i think
im only gonna be using worldedit, worldguard and luckperms
and my plugin
and changing names isn't for ranks
its to show their team in the minigame
not using other plugins is not really an excuse for bad code
look at how TAB does it, go from there.
tab?
oh
i know
okayt
where would be the part
where they get the name
and change it
or whatever
@sage swift what is the class where they change it
im trying to make it 1 method ideally
cuz im only trying to change their name
not add like 50 other lines
why would i know
idk
private void loadNametagFeature(TAB tab) {
if (tab.getConfiguration().config.getBoolean("change-nametag-prefix-suffix", true)) {
if (tab.getConfiguration().config.getBoolean("unlimited-nametag-prefix-suffix-mode.enabled", false) && ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 8) {
tab.getFeatureManager().registerFeature("nametagx", new NameTagX(plugin, nms, tab));
} else {
tab.getFeatureManager().registerFeature("nametag16", new NameTag(tab));
}
}
}```
i could try using teams
idk how to start
i update scoreboards every second so i think that will bug out teams
do you know how to use teams for updating name above heads
People don’t always want to spoonfeed code
if (location.getWorld().getNearbyEntities(location, 1.0, 1.0, 1.0).size() != maxIdleEntities) {
location.getWorld().dropItemNaturally(location, drop);
}```
the maxIdleEntities is 4
and there is 7 diamonds just sitting there
=
i copied it cuz idk how
apparently it changes ur name
which it does
but it kicks u
when u kill someone
or reload
The name field cannot be greater than 16 characters
yeah but my minecraft name is Quared
and it adds a chatcolor to the start
wait
does this method change the .getName() method
in a player
It also counts color characters
i'm sure he appreciates the ping
In my Yaml file i have itemNames which holds different strings. Is there an easier way to get the total amount of children stored in itemNames, or do you have to loop through it?```
itemNames:
1: thing 1
2: thing 2
3: thing 3
getList
or getStringList
or whatever else the values may be
then .getLength or whatever
ok thanks
getConfigurationSection("path").getKeys(false)
ok
how to get number of mined stone?
ask the player nicely
Hey! Any great videos for getting set up with intellij? I'm an experienced Java Developer with limited intellij experience and beginner-level spigot plugin development experience. In other words, I know how to code, I just need the specific knowledge for creating spigot projects in intellij
there is this: https://plugins.jetbrains.com/plugin/8327-minecraft-development which can bootstrap plugins for you
besides that, plugin development on intellij really just mirrors development of any java project with the respective build tool
besides that, plugin development on intellij really just mirrors development of any java project with the respective build tool
if you are using maven there is https://www.jetbrains.com/help/idea/maven-support.html
Thank you!
whats the state of a block? ```BlockState getState()
Captures the current state of this block. You may then cast that state into any accepted type, such as Furnace or Sign.
The returned object will never be updated, and you are not guaranteed that (for example) a sign is still a sign after you capture its state.
Returns:
BlockState with the current state of this block.```
like if its placed or not?
im using
Block b = chestLocation.getBlock();
Chest chest = (Chest) b.getState();
tag me please
what are you trying to do
i always do it this way, get the block, cast the state of the block to a chest and then get the inv of the chest
Chest chest = (Chest) b.getState();
Inventory chestInv = chest.getInventory();```
but never really understood what the state of a block is
Tile entity
For example a chest has tile entity info on whether it's open, what items are inside, etc.
the state of a block represents a snapshot of a block's state
that is, a snapshot of all information pertaining to that block
orientation, location, type
for tile entities, the actual tile entity itself
the written text on a sign, the contents of a chest
ah thank you
So I'm trying to create a plugin that is like hungergames and the seed will reset every game I'm just wondering how I would go about doing that, I'm pretty new to plugin dev
Could someone help me please?
There is a trouble with creating somekind of "SignEditor" (sign inputs) for 1.12.2 version - player is able to see sign and sign's updated content, but editor doesn't open.
Code - https://pastebin.com/xDqW0Mee (this class doesn't contain listener, because i'm in halfway of rewriting deleted version in rage)
Original post with images - https://spigotmc.org/threads/opensigneditor-packet-doesnt-work-properly.504262/
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
when i do World#dropItemNaturally or World#dropItem it spawns in with a momentum
to the side
why
why cant it just spawn there
and not move
hmm
try treating it as an entity and #setVelocity?
setVelocity to 0,0,0?
try that
idk if itll work
probably because it called naturally?
you can set velocity of item to zero to prevent any movement
your profile picture hurts me
why 3:
i am in genuine throbbing pain
Item i = location.getWorld().dropItemNaturally(location, drop);
i.setVelocity(new Vector(0.0, 0.0, 0.0));```
or dropItem
which one
.dropItem(...) + .setVelocity(new Vector())
If I recall correct dropItemNaturally adds random offsets
So you probably want dropItem
Pretty sure it’s just Wheat, Carrots, and Potatoes
if (data == 7) {
e.getPlayer().sendRawMessage("This worked. Here's a cookie !");
ItemStack cookie = new ItemStack(Material.COOKIE, 1);
e.getPlayer().getInventory().addItem(cookie);
e.getPlayer().updateInventory();
}
^ im trying to do something simple here, this works. but I need it to work for certain stuff.
for example
how do i use the black thing around the code
3 `
Probably a hardcoded value in NMS
e.getPlayer().sendRawMessage("Yes, This worked. Here's a cookie !");
ItemStack cookie = new ItemStack(Material.COOKIE, 1);
e.getPlayer().getInventory().addItem(cookie);
e.getPlayer().updateInventory();
}
void is hardcoded in minecraft
But you could probably use a runnable or the move event to damage players
it's not something you can change
bruh moment
now this wouldn't work.
you can probably replicate it but can't change it
You need to wrap all your || in another pair of brackets
can i fire the damage event with EntityDamageEvent.Cause.VOID when someone goes below Y=0
why are you checking whether a block is wheat
that will never get satisfied
If (A && (B || C || D))
ty
wdym
you can damage the player and set the cause to void
How do you event damage a player with a certain cause
well, it's a crop not a block.
Yes it can?
ah gotcha
What do you think the block form is called
forgot crops were a thing hush
still doesn't work
Are you in modern versions
Not really.
Ah, legacy material names, good luck
@EventHandler
public void onMove(PlayerMoveEvent e) {
Player p = e.getPlayer();
if (p.getLocation().getY() <= 0) {
Bukkit.getServer().getPluginManager().callEvent(???);
}
}```
what
what do i do from here
create a new event
i know
well it actual might damage the player
it's a cancellable event, thus meaning theres a handler that damages them at the end
there is a damage parameter
It doesn’t damage the player
Description: Exception in server tick loop
java.lang.NullPointerException: Exception in server tick loop
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:343)
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:218)
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809)
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164)
at java.lang.Thread.run(Unknown Source)
can somone help?
show code
works ty
wdym?
this is help-dev
that isnt code
So where do i get help for that?
what is it relating to
because "help please" doesn't give much background
when does it happen
please show all the stack trace
nvm i got it
perhaps share what the issue was?
okay i made my switch to the latest version.
if (ageable.getAge() == ageable.getMaximumAge() && b.getType() == Material.WHEAT || b.getType() == Material.POTATO || b.getType() == Material.CARROT)
for some reason it works with wheat but not carrots.
idk about potatoes ill check
yeah also doesn't work with potatoes.
what are you trying to do?
I'm trying to detect whether the crop is fully grown before harvested.
and also add a ( )
perhaps it is Material.POTATOES and Material.CARROTS ??
Yeah, I changed it. had to change the code so i figured removing the whole thing and i forgot to add it.
yeah that seemed to fix it
mojang
however it does kind of make sense. there is a single carrot in the item texture, but multiple carrots in the crop texture ;p
How can I convert &bPrefix to &b[Prefix] with code?
wym? 👀
That would be a hassle to implement, I suggest just adding the brackets manually 
yea i thought so, it's gonna be complicated
it would give the end-user more customization, if they want to use brackets, parenthesis, or nothing at all
np c:
Currently trying to make a plugin and i am using the playerDeathEvent i am trying to respawn the player after using Player player = e.getEntity(); then using player.spigot().respawn() to respawn the player. this works if i do /kill myname but if i die to a skeleton it gives a null error saying Removed entity while ticking.
add a delay possibly?
to the respawn or entire but of code on death?
respawn
unless you do other stuff after the respawn, then put that stuff in there too
whyy does BlockPistonRetractEvent get called once for the piston itself and once for all the blocks
in one the direction is the way the piston is facing and getBlocks is empty
i died to a spider and it worked with the delay. that may have fixed it. Thank you 🙂
in the other the direction is the way the blocks are moving and getBlocks actually has blocks
Is this discord server also related to Bungeecord (I wanted to ask a question)? Or I should try search for it again in google
can I connect a player to a server which is not in the config?
not without a plugin designed to do that
you need to create a ServerInfo and add it, see ProxyServer.constructServerInfo
ok, thank you
why is this getting a skeleton_skull im on 1.8
ItemStack skull = new ItemStack(Material.SKULL_ITEM);
SkullMeta skmeta = (SkullMeta) skull.getItemMeta();
skmeta.setOwner(ChatColor.stripColor(pp.getPlayer().getName()));
skmeta.setDisplayName("e");
skull.setItemMeta(skmeta);```
nvm
had to set the durability
lmfao
how can i properly copy world and load it without getting error?
So i have a folder in my plugin where you have three variants of worlds that will copy to player and then load it but i am getting an error when loading the world.
Code: https://paste.md-5.net/oximenajuh.java
Error: https://paste.md-5.net/zitinozuje.sql
By any chance, have you heard of https://github.com/Paul19988/Advanced-Slime-World-Manager, and considered if it works for your use case?
^^ Now that's a good idea if you're making a minigame
Which sounds like something they're doing since i cant imagine anyone wanting to handle large file operations in a plugin
^^
i didnt
What are you using this for then?
So i have a folder in my plugin where you have three variants of worlds that will copy to player and then load it but i am getting an error when loading the world.
Yeah we know that but why
what why
that sounds like a perfect use for a-swm, either way, you might want to consider using java 14+ for useful nullpointers
objectset is null
yeah and what is that?
at pavlyi.customer.worldcontrol.utils.WorldHandler.createWorld(WorldHandler.java:45) ~[?:?]
Hello, here! What should I do so that only certain players can see and pick up items? I looked it up on Google, but it's not there. I think we should use the packet.
worldName is "P4vlyi"
44: WorldCreator creator = new WorldCreator(worldName);
45: World newWorld = instance.getServer().createWorld(creator);
either WorldCreator returned null or instance returned null
likley something with worldcreator
ill try bukkit
bcz instance cant be null
tried World newWorld = Bukkit.getServer().createWorld(creator); same error
What spigot version are you using?
1.16.4
Update
what?
Update to the latest version of Spigot
okay
Hey ya'll.
I cannot figure out this error:
04:01:35 ERROR]: Could not load 'plugins\GarrysEmeralds-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Symbol does not appear in the shape:83
could you send full stack trace?
[04:01:35 ERROR]: Could not load 'plugins\GarrysEmeralds-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Symbol does not appear in the shape:83
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:382) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.lang.IllegalArgumentException: Symbol does not appear in the shape:83
at org.apache.commons.lang.Validate.isTrue(Validate.java:93) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:128) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:113) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at io.github.garrysemeralds.EmeraldHelm.<init>(EmeraldHelm.java:52) ~[?:?]
at io.github.garrysemeralds.MainPlugin.<init>(MainPlugin.java:12) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_282]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_282]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_282]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_282]
at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_282]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
... 7 more
Line 52:
recipe.setIngredient('S', Material.STICK);
Line 12:
EmeraldHelm emeraldHelm = new EmeraldHelm(this);
And S is inside the recipie?
could you send the whole method in EmeraldHelm?
public class EmeraldHelm {
private final MainPlugin mainPlugin;
public EmeraldHelm(MainPlugin plugin) {
this.mainPlugin = plugin;
// Our custom variable which we will be changing around.
ItemStack item = new ItemStack(Material.DIAMOND_HELMET);
// The meta of the diamond sword where we can change the name, and properties of the item.
ItemMeta meta = item.getItemMeta();
// We will initialise the next variable after changing the properties of the sword
// This sets the name of the item.
// Instead of the § symbol, you can use ChatColor.<color>
assert meta != null;
meta.setDisplayName("§aEmerald Helmet (Blue)");
// Set the meta of the sword to the edited meta.
item.setItemMeta(meta);
// Add the custom enchantment to make the emerald sword special
// In this case, we're adding the permission that modifies the damage value on level 5
// Level 5 is represented by the second parameter. You can change this to anything compatible with a sword
//item.addEnchantment(Enchantment.DURABILITY, 3);
// create a Namespaced Key for your recipe
NamespacedKey key = new NamespacedKey(plugin, "emerald_helmet");
// Create our custom recipe variable
ShapedRecipe recipe = new ShapedRecipe(key, item);
// Here we will set the places. E and S can represent anything, and the letters can be anything. Beware; this is case sensitive.
recipe.shape("EEE", "E E", " ");
// Set what the letters represent.
// E = Emerald, S = Stick
recipe.setIngredient('E', Material.EMERALD);
recipe.setIngredient('S', Material.STICK);
// Finally, add the recipe to the bukkit recipes
Bukkit.addRecipe(recipe);
}
}
OH
DERP
you dont have S anywhere?
yeah things happen sometimes
I was copy pasting this across so many methods and this is the first one that had a blank in a row
or not use a stick
thank you
Iterator<Recipe> it = Bukkit.getServer().recipeIterator();
Recipe recipe;
while (it.hasNext()) {
recipe = it.next();
if (recipe instanceof FurnaceRecipe || recipe instanceof BlastingRecipe) {
if (((CookingRecipe<?>) recipe).getInput().getType() == Material.NETHER_GOLD_ORE) {
it.remove();
}
}
}
why isnt this working
in what type
it isn't removing recipe
Hello, here! What should I do so that only certain players can see and pick up items?
Here's my code:
ItemStack i = new ItemStack(Material.OAK_LEAVES);
EntityItem item = new EntityItem(((CraftWorld) event.getEntity().getWorld()).getHandle(), 1, 1, 1);
item.setLocation(smarlet.getLocation().getX(), smarlet.getLocation().getY(), smarlet.getLocation().getZ(), 0 ,0);
item.setItemStack(CraftItemStack.asNMSCopy(i));
PacketPlayOutSpawnEntity packet = new PacketPlayOutSpawnEntity(item, 2);
((CraftPlayer) entity).getHandle().playerConnection.sendPacket(packet);``` But not working. and not erros
just do event PlayerPickupItemEvent or smth like that
no thanks, i don't want do that 🙂
how should i register a command?
getCommand("commandName").setExecutor(new CommandClass());
i tried that and got java.lang.NullPointerException: null
could you send whole error?
yea 1 sec
java.lang.NullPointerException: null
at core.Main.initilize(Main.java:19) ~[?:?]
at core.Main.onEnable(Main.java:14) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-648]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.5.jar:git-Paper-648]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.5.jar:git-Paper-648]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.5.jar:git-Paper-648]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.5.jar:git-Paper-648]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:591) ~[patched_1.16.5.jar:git-Paper-648]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:281) ~[patched_1.16.5.jar:git-Paper-648]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1065) ~[patched_1.16.5.jar:git-Paper-648]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-648]
at java.lang.Thread.run(Thread.java:830) [?:?]
whats on this 19 in Main
this.getCommand("spawn").setExecutor(new SpawnCommand());
do you have spawn in plugin.yml?
then ig that is error
there isnt a way to register commands without adding each one in plugin.yml?
nope
There is but don't
wait there is?
why not?
if anyone has any idea, ping me pls
would that require reflections or something
Don't be lazy and add it to your plugin.yml
yeah its quicker
alright thanks
Yes
oh ok
should i be putting this in Objects.requireNonNull()? intellij wont shut up
Oh alright
I mean I would do smtng like this
PluginCommand command = super.getCommand("spawn");
if (command == null) {
new RuntimeException("Missing command property in plugin.yml").printStackTrace();
super.getServer().getPluginManager().disablePlugin(this);
return;
}
command.setExecutor(new SpawnCommand());
I'll just make sure to add each command in plugin.yml, I won't be making this plugin public anyways
Thanks for the help, I just started java yesterday
How Can I Replace All Mobs Texture With One Mob Texture Eg. Creeper?
Oh yeah then just ignore the warning prim
👍
Any Help
You’d have to use some sort of resource pack I guess
Or maybe that’s not even enough
Well, you could technically do nms stuff
And mess with packets
yeh, packets
Yes I tested it with resource pack by replacing every mob png with Creeper.png but You know every mob have different Head and Body texture etc.
You can override the mob geometry in a resource pack too
Hmm yeah jackwasd probably a very hacky solution if it even works
Couldn't you set the custom geometry for the entity through the api?
you could set the mob invisible if it's not what mob you want them to look like them use a mob of whatever type you want them to look like with no ai at the location of those mobs, you'd probably wanna do quite a bit of trial and error to find your preferable method for look/feel but this way could work
however if you can achieve this differently with a resource pack that'd be better for sure
a datapack may work for you aswell?
Ultimately setup a packet listener which listens for outcoming packets then manipulate all entity related packets so that they contain the entity type id of a creeper.
Okay i have to replace every mob texture with creeper then i have to add geometry of creeper into every other mobs. Is this the correct way of doing it ?
Do what conclure just said
Okay thank you very much
I didnt really help much but you're welcome
I think protocollib has an api or smtng for doing that so you don’t have to mess with raw netty and nms
I prefer making plugin rather than a resource pack.
Sure
hi
and it is possible to make the spigot server send packets to bungeecord? Or is it impossible to do this?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thx
https://paste.md-5.net/ayoxopomam.xml
Annotation processor 'me.tvhee.api.annotations.TvheeAPIAnnotationProcessor' not found```
What am I doing wrong? (Class extends `AbstractProcessor`)
How can I detect if the player is jumping
its hard- jumping is mostly client side
(if you are making a paper plugin you can use Paper's jump event)
any1 🙂
You should use the pick up item event. Listen to it and simply cancel the event.
Depending of your minecraft version, you have the PlayerPickupItemEvent or the EntityPickupItemEvent (you'll have to check if the entity is a player).
Or you can try Player#setCanPickupItems(); but idk if that works
I dont see how I can use this
and no im not using paper
Listen for the statistic increment event and check if it’s the jump stat
Probably the most reliable ish way
yeah but uh... jump stat increases when water makes u jump aswell
check if the player is in water, maybe?
Yeah you can do some filtering to try and make it more accurate
or just use paper :fingerguns:
no thanks, 😦 as I said I don't want do that
"see and pickup"
i want another player not to see
send a entity destroy packet in the pickup event for every other player
For see you probably need some packets
the picking up animation is clientside
yaaa
should I use destory packet?
which event are we talking about
hmm
you meant, we need destory packet in pickup event?
ok i'm going to start learn event packet
The jump event
what
it's in the playerconnection class
basically just checks if the player is trying to move upwards and if the player is currently on the ground
with a few other checks here and there
hmm
im first at packet, and I can't understand sryt
What I understand is as follows. PickupItemEvent uses Destory packets to do well.
Interesting
is there something like config.getRecipe() because my plugin needs to save custom recipes in the config so they can be accessed when the server restarts
how can i import a decompiled jar to intellij and edit it as if it were a normal one that i created? (it doesn't have to do directly with spigot but i'm really confused)
IntelliJ isn't the best IDE for that, I recommend recaf or similar
Otherwise, decompile manually with Fernflower or another decompiler
serialize your recipe into something that can be stored in the config
Recaf = Epic
So, i am trying to make it so that the terrain only genertates in a, lets say, 2 block wide strip on the x axis, as if you were playing terraria. There are two ways of doing this as far as i am aware and wondered if i could get some help:
-
Make a custom terrain generator that only generates the blocks needed. This would be ideal, however i do not know if i can 'inherit' the default algorithm and then manipulate it so that things like lava pools still form, just only 2 blocks of them.
-
Listen to an Event such as the Chunk load event and then manipulate the block data. This is definitely more expensive, but i am just trying to get it to work. I keep getting this error:
[12:17:31] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=-223, y=22, z=-535} but found not block entity block Block{minecraft:stone} at location
[12:17:31] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:stone} but failed at location BlockPosition{x=-223, y=22, z=-535}
When i set blocks like this:
@EventHandler(
priority = EventPriority.HIGHEST,
ignoreCancelled = true
)
public void onPopulate(ChunkPopulateEvent event) {
Chunk chunk = event.getChunk();
BlockState[] tileEntities = chunk.getTileEntities();
for(BlockState blockState : tileEntities) {
net.minecraft.server.v1_16_R3.Chunk nmsChunk = ((CraftChunk) chunk).getHandle();
nmsChunk.removeTileEntity(new BlockPosition(blockState.getX(),blockState.getY(),blockState.getZ()));
}
for (int y = 0; y <= 150; y++) {
for (int x = 0; x <= 15; x++) {
for (int z = 0; z <= 15; z++) {
Block block = chunk.getBlock(x,y,z);
setBlockFastnms(block,Material.STONE);
}
}
}
}
I think that it is due to the chunk possibly not being generated fully however a delay doesn't fix it
the setBlockFastnms is:
public void setBlockFastnms(Block block, Material type) {
net.minecraft.server.v1_16_R3.Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();
chunk.removeTileEntity(new BlockPosition(block.getX(),block.getY(),block.getZ()));
CraftBlock cb = (CraftBlock) block;
IBlockData data = CraftMagicNumbers.getBlock(type).getBlockData();
chunk.getWorld().notify(cb.getPosition(), cb.getNMS(), data, 0);
chunk.setType(cb.getPosition(), data, false);
}
I realise now that the top blockstate remover is redundant
Any ideas?
Ideally i would like to actually change blocks, and avoid packets
have you tried doing it through the api
setting almost every block in a chunk every time the chunk generates is going to be slow as balls anyway, so you might as well put the nms hacks in the corner and just embrace having to pregenerate the world
Hmmm, that would potentially work
most people pregenerate worlds anyway
Iterator<Recipe> it = Bukkit.getServer().recipeIterator();
Recipe recipe;
while (it.hasNext()) {
recipe = it.next();
if (recipe instanceof FurnaceRecipe || recipe instanceof BlastingRecipe) {
if (((CookingRecipe<?>) recipe).getInput().getType() == Material.NETHER_GOLD_ORE) {
it.remove();
}
}
}
it isn't removing recipe
especially on splögget since they haven't invented async chunk generation yet I don't think
Idrk how to go about this tbh
i was going with nms cause it was faster than the bukkit route
how do i convert 60 days to millis?
with math
ty
lmao
how many hours are there in a day?
24
how many minutes are there in a hour?
60
how many seconds are there in a minute?
milli is the SI prefix for one thousandth
or can i use TimeUnit.DAYS.convert(60, TimeUnit.MILLISECONDS);?
yeah
yuhuh
that is the noob way of doing it
well im not good at math
i'm sure you can still multiply a few numbers together
literally gave you the formula
but yeah, the TimeUnit conversion is fine
Hey! I'm making a spigot plugin an i have a TOML Configuration:
[commands]
"* * * * *" = [
"say This Message Is Sent Every Minute!",
"alert This Message Is Broadcasted Every Minute!"
]
"0 0 * * *" = [
"say Midnight Strikes!"
]
``` ideally i'd want to get all the keys and all the values from the `commands` section, and then read the key and the value.
I'm using `com.moandjiezana.toml`, and this is my code, Toml#entrySet() however it doesn't return the value, just the raw text separated
My code:
```java
Toml commands = toml.getTable("commands");
for (Map.Entry<String, Object> entry : commands.toMap().entrySet()) {
LoggerAdapter.info(logger, entry.getKey() + ": " + entry.getValue());
}
[13:24:56 INFO]: [execute] Enabling execute v0.1.0
[13:24:56 INFO]: "0 0 * * *": [say Midnight Strikes!]
[13:24:56 INFO]: "* * * * *": [say This Message Is Sent Every Minute!, alert This Message Is Broadcasted Every Minute!]
why TOML tho
it could be argued that it indicates your intention better and as such is better code
but using the actual numbers makes it look more 1337 so that's not an argument
why does this remind me of crontab?
its a cron thing
explains why youre using a crontab like syntax lol
yeah, so any idea on how i would get stuff like 0 0 * * * instead of "0 0 * * *"
ig use replace?
but i dont think thats a very proper way of doing it, plus using replace on something else like [say This Message Is Sent Every Minute!, alert This Message Is Broadcasted Every Minute!] would be horrible
i meant on the key not value
dont put the "" in your config?
@wraith rapids should i use a WorldCreator?
i don't know
i think toml lets you have spaces in keys
i don't really fuck with world generation
fair enough, i was looking at the docs and i see this 'custom'
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.Environment.html
declaration: package: org.bukkit, interface: World, enum: Environment
idk what it is a placeholder for though
you should ask on the paper discord, they'll probably help you with how to set up a decent world generator and maybe be able to answer your inheritance question
nope doesent work
ok
does anyone here use intelliJ idea
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
that was the question lmao
yes
can anybody help me i wrote a report plugin when i open the reportsmenu i can take the items out of the inventory the code:
try debugging it where it stops
or is in the line 95 supposed to be this Reportmenü instead of Reportmenu
There is a method, however it is paper specific
quite a few things are paper specific :fingerguns:
no this is german its mean reportmenu xd
code should generally be written in english
yeah but its a string its only like a message i cant write also RePorTsMenu yk ?
Do you use maven too? it becomes tedious to package > copy > paste > /reload every time i want to check/test/anything like that. Is there a way to tell maven where to put the jar every time i package?
it really is a quality of life question but thought i'd ask anyway haha
ah yes, messages
yes xd
ideally they would be localized and pulled from somewhere else but yeah messages are fine to be in whatever ching chong language you prefer
yeah i know i can also use another language like spanish you know what i mean
If you're using the Maven shade plugin you can set the outputFile. Example:
<configuration>
<outputFile>./run/plugins/${project.artifactId}-${project.version}.jar
</configuration>
i'm sure there's also some maven plugin out there solely for changing the output directory
Not ever used Maven shade before, don't want to trip up on too many things at once while im still learning 😆
wow
rate my html formatter
wow
what is that gay shit in the bottom right hand corner
Alright since you're not using the shade plugin just add this to your build section:
<outputDirectory>./run/plugins</outputDirectory>
Ofcourse you can change the path to anything you'd like
maven
oh and if you don't have a build section just add <build></build> and put it in there
funnily enough i've never actually had a build section. can i just throw a
<build>
<outputDirectory>
</
</
at the end
oh okay cool
package soldier;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Commands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
//Here we have our basic command
if(sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage("Hello Player!");
} else {
sender.sendMessage("§cYou need to be a player to run this command!");
}
return true;
}
}
i see you've gone back to eclipse
could you send the screen without that message
someone taught me how to make plugins with it
the method signature looks right to me
Expand your imports
show the imports
they were included in the message he sent before
oh yea my bad
unless he changed them in between sending it and taking the screenshot
ig try reloading the ide
which, like, knowing him 👀
Right click your pom -> maven -> update project
ensure the bottom 3 options are ticked and press ok
It worked. Thanks
Hey guys, can anyone tell my why my stream is running the isPresent and also the else of it. (The isPresent he should run)
List<String> jobsList = communications.getLoader().getSmsManager().jobsList;
if(jobsList.isEmpty()){
jobsList.add("DAB");
jobsList.add("KSPD");
System.out.println(jobsList);
}
jobsList.stream()
.filter(job -> job.equalsIgnoreCase(args[0]))
.findFirst()
.ifPresentOrElse(run -> {
communications.getLoader().getSmsManager().sendSMS(rpPlayerSender, args, false, args[0].toUpperCase());
}, () -> communications.getLoader().getSmsManager().sendSMS(rpPlayerSender, args, false, ""));
It can;t run both ifPresent and OrElse
ifPresent will give you args[0].toUpperCase() OrElse will give you ""
Thx I found the problem. I forgot an return in my other class
Is it a problem have many threads? Like 100actives and 300sleeping?
So long as you are not creating and disposing of threads all teh time its ok
ook.
just keep in mind that each thread allocates memory for its stack
Mh, I probably should have a powerful machine...
I'd probably look into why you are using so many. If you really need them
can you list the thread names
I don't really need them. But I need to do a thing fast
i know luckperms had an issue at one point where it spawned like 100s of worker threads
well 100 threads don't make a thing do fast
100 threads makes 100 times more context switching
you only have x physical processors and they can only spin x threads at once
https://haste.l4zs.de/azukunigot.cs can anybody help i can take the items out of the inventory idk what can i do
No, I don't mean fast execution, I mean that this is the first idea that i came up with
sounds like bungee's scheduler system
which just spawns and sleeps a fucking thread every time you schedule something
I could do all of the work in just one thread, but i should synchronize everything...
yeah, I will.
Now that I think, I could do all I need without synchronizing anything. I just need a thread that runs every tick..
Is it better?
i don't know
i have no idea what you're doing
or what you mean by synchronization
you ask very vague questions
you should fill the air with barriers so players don't fall out
thats not the pressing concern
in the world gen i have to:
@Override
public boolean shouldGenerateStructures(){
return true;
}
So you end up with stuff like this:
uh
iirc structures can only spawn in certain biomes
you could try setting the biome of the empty chunks to something that can't spawn any structures
of course you would still have structures hanging off the border of the filled and empty chunks, because structures can't really be cut in half
some know why i getting that error ?
have you tried using maven
check your permission
Clean your project, check folder permissions, and do a rebuild
or even better, try using maven
i mean, things like mineshafts don't overrun
thats a shout about the biomes, i have set the empty ones to 'void' now
"just use Maven" is as bad as the people that say "just use IntelliJ"
like, that wasn't the fucking question lol
lmao
Sure. Explore Maven, but that's not going to answer the question that was asked
do you know how to prevent structues from generating choco
with a ChunkGenerator that is
lol
you don't always need an answer to the question asked
sometimes you need an answer to the problem you're having
just tried building Geyser (uses maven) and its SOOO SLOW
took like, 5 minutes, just to give me a compiler error lol
doesnt even tell me what went wrong
lmao
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project bootstrap-spigot: Fatal error compiling
lmao
handy
what does @Override mean ex for onCommand?
regardless i ended up using their ci builds instead
Perform a project clean under teh project menu. You probably have old and outdated files.
i alread solved
it means youre replacing a method defined in your base class (for example im assuming JavaPlugin)
override means that you are overriding a command declared by a class you're extending/implementing
but other thing
okay ty
the CommandExecutor interface declares a method, and you implement it by overriding it
private void drop(final Player player) {
final Inventory inventory = player.getInventory();
final World world = player.getWorld();
final Location local = player.getLocation();
List<ItemStack> items = new ArrayList<ItemStack>();
for(int i = 0; i < player.getInventory().getSize(); i++) {
items.add(inventory.getItem(i));
}
items.stream().filter(e -> e != null).forEach(e -> world.dropItem(local, e));
items.clear(); inventory.clear();
// Arrays.asList(inventory.getContents()).stream().forEach(item -> {
// inventory.remove(item); player.getWorld().dropItem(player.getLocation(), item); }
// );
}```
i have that method for drop all itens of player
Wait, how do you set the biome of a chunk
but dont drop my armor
arent biomes per block/column?
not anymore
what does the biomegrid contain then?
it used to be a grid of 16x16 columns going from bedrock to sky
then it was per-block
now it's per 4x4x4 cube
for performance and memory i guess?
do i have to iterate over all of them to set them?
probably, dunno
inventory#getContents() shoudl give you all ItemStacks including armor
i tried it and i getting null exception
only drop if not null
This seems to suggest that it is per block if it is 0-15?
private void drop(final Player player) {
final Inventory inventory = player.getInventory();
final World world = player.getWorld();
final Location local = player.getLocation();
Arrays.asList(inventory.getContents()).stream().filter(e -> e != null)
.forEach(item -> {
inventory.remove(item);
player.getWorld().dropItem(local, item); }
);
}```
I'd drop them all then just perform a clear on teh inventory once done
it's not per block anymore, but it used to be
because it used to be that way
and the api needs to reflect what a biome is, not how it's implemented
its true now i see
the api also can't just change the way how it treats parameters
ok
because that would break the fucking 1.8 plugins that nobody uses anymore
dont drop my armor
so ?
so it won't drop it
you aren't iterating over the fucking armor slots
because it doesn't return the armor slots
so you aren't dropping the armor slots
so how i get it
see the docs
👍
those are not the fucking docs
Player.getInventory().getArmorContents()
yes ik
calm it man
tilt
the problem that doesnt necessarily have to be docs just looking at the methods that exist within a class
and there is no armorcontets method
PlayerInventory inventory = player.getInventory()
then you can get the armor contents
^ Inventory != PlayerInventory.
same reason you can't call getItemInMainHand() on Inventory
Uploaded a video of me using this shovel that I tried to make.
Does anyone know why it acts like this? It only does this with Grass Blocks. I'll post the code and video below.
https://b.catgirlsare.sexy/fv0RGwn1.mkv <-- video
https://paste.md-5.net/ifotozusuq.java <-- code
sure lol. if i was on the receiving end i just would have preferred to not have to click a link :p
np, just a big thing of text 😄
why i cant add enchants to chest item using this chestMeta.addEnchant(Enchantment.DURABILITY, 10, true);?
have you re-applied the new meta? @graceful turret
but you can do player.getInventory().getItemInMainHand() or something.
35 votes and 23 comments so far on Reddit
i replicate the same behaviour
i think that it is just minecraft?
It's weird, because using another plugin (like mcmmo), there is absolutely no difference between grass and dirt
I want to replicate that effect
oh, you were clarifying why there aren't method like getItemInHand, etc on the images above.
yeah
this will create a random num between 0 and 100 right?
return r.nextInt(100);```
1uestion
plesa
s
16:54:10 [SEVERE] java.lang.IllegalArgumentException: Server lobby (priority 0) is not defined
16:54:10 [SEVERE] at com.google.common.base.Preconditions.checkArgument(Preconditions.java:359)
16:54:10 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:135)
16:54:10 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:272)
16:54:10 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
16:54:10 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)```
help
show code
this is from
bungee proxy
just wanted to ask
for help
Bruh
wwwwhy didnt
i
sorry to disturb your programming
continue
could someone point me in the right direction to putting an item in the creative menu
i've looked in classes that i thought make sense but don't see anything about putting items in creative menu
creative menu?
yeah like list of all items
like the gui when you press e
yes
wait what? you don't think it's possible? :O
Is there a way to stop structures from generating in specific chunks when using a ChunkGenerator
One of your servers has to have priority 0. It will be the server to which it connects players first (i.e. the lobby). You do not have that.
you can make new achievement and advancement tabs but not a new tab or entry in the items list in creative mode? :O
how do you make one server to priority 0
In your bungee config
There's a priorities option in the bungee config
It's a list of servers
listeners:
priorities
- yourhubserver
If you have multiple lobby servers, list them all
does it do them in round robin or fill the first one?
They'll be in order from most important (highest) to least important (lowest) but they'll all try to be connected to
afaik
how can I teleport the player to a random location in a 5000 block radius
get a random number between 0 and 5000
create a location with x and z as the random number
but around the playter?
wdym?
like
you can teleport using Player#teleport(location)
yes
so how can I do that
create a command
command?
uh what?
Ok imam reexplain it sorry for bad english
I want it so the player gets randomly teleported to a location around the player in a radius of 5000 blocks
why around the player
cuz I need it to be around the player
same thing, generate the random number
but all you would do is as @summer scroll said, get a random number for x and z, then add the players x and z to allow for offset
then do some stuff with negatives
Can i hide certain Console Warnings?
Because ik why they are happening but there is nothing i can do about them
So i just need to stop them
just teleport the player to an x, y, z
.add()
add doesnt seem to work
Yes but how can I add the random value to x and z
playerLocation.getX() + randomX, y, playerLocation.getZ() + randomZ
thats your coords
how
or generate between 2500 and have a 50% chance to be negative
how are you generating the number?
Random ran = new Random();
return ran.nextInt(5000);
can you do (-5000,5000)
thats a 10k radius
well do (-2500,2500)
You need to use an offset
?
ran.nextInt(upperbound-lowerbound) + lowerbound;
so
return ran.nextInt(2500-(-2500)) - 2500;
wait no in that case upperbound shoudld be 5000
no
yeah it could be
World#getHighestBlockAt
what am I doing wronmg
event.getEntity().teleport(loc.getX(), loc.getWorld().getHighestBlockAt(loc), loc.getZ());
nvm
Yeah
Cannot resolve method 'getHighestBlockAt(double, double)'
use getBlockZ and getBlockX
why not just loc.setY(loc.getWorld().getHighestBlockYAt(loc);
oh well
Ok
whats wrong with this
player.addPotionEffect(PotionEffectType.BLINDNESS, 60, 5, true, false, false);
Cannot resolve method 'addPotionEffect(org.bukkit.potion.PotionEffectType, int, int, boolean, boolean, boolean)'
Yeah no
no? ok
You need to create a potion effect then add it
Just wrap new PotionEffect() around your arguments
oh
like this?
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60, 5, true, false, false), false);
idk what the last boolean does
force - whether conflicting effects should be removed
no need to force since multiple effects of the same type are now supported.
depreciated method type beat
nope
ok
Huh
uh another question... can I make it so it doesnt crash
cuz of the chunks are not loaded
check if chunk is loaded or not
Can someone send me an example on how to use websocket protocoll in a plugin (client side)? Cant find one atm
you meant load chunk by yourself?
not mc?
I dont see anything about loadin g