#help-archived
1 messages · Page 220 of 1
is something like this example what I'm looking for then? https://github.com/mbax/AbstractionExamplePlugin
Yes that's how it's done
ok ty
Why is PayPal putting all my spigot plugin sales on hold?
how do I even confirm a payment if they want me to set it as “shipped”? Doesn’t the plugin just outright not go to the buyer unless the transaction is okay? Do I issue refunds or what’s supposed to happen?
Am planning to give PayPal a call tonight
Just asking here, was hoping someone ran into something similar
are you new into your paypal account?
Yes
well that's the reason
the reason for holds are either if you're new or the buyer is new or not safe
i doubt
you need to verify it
or it fixes itself with time
i forgot
This could also be caused by too many ppl demanding a refund
You mean I can’t verify each transaction? It makes things very complicated though
CrouchToggle..
@tranquil plaza What... There is a crouch event...
whoops wrong event
declaration: package: org.bukkit.event.player, class: PlayerToggleSneakEvent
PlayerToggleSneakEvent
Because PayPal says a bunch of on-hold payments will be cancelled soon
wrong name actually*
Hey everyone!
I have a question/bug regarding aliases
I am new to Spigot, and haven't checked if this problem exists in other versions besides latest (1.16.1)
The problem is:
My aliases are registered to the command list in the server (they are suggested in the tab completer if I just press /)
But most of them aren't really registered, meaning I get Unknown command. Type "/help" for help when I call the command using the alias.
plugin.yml as follows:
commands:
addGravityBlock:
description: Add a gravity affect to a block.
usage: "§4Usage: /addGravityBlock <block> <gravity>"
aliases: [gb, gbAdd]
removeGravityBlock:
description: Remove a gravity affect from a registered block.
usage: "§4Usage: /removeGravityBlock <block>"
aliases: [gbRemove, gbRem]
listGravityBlocks:
description: List all blocks registered with a gravity affect.
usage: "§4Usage: /listGravityBlocks"
aliases: [gbs, gbList]
@tranquil plaza https://gist.github.com/Flo0/7a50063e5b7c1a06dc1d7aed29c040cd
Register this Listener and you got a PlayerTwerkEvent you can listen to.
Amazing
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public void onEnable() {
this.getServer().getPluginManager().registerEvents(new NetherStar(), this);
}
public void onDisable() {
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (label.equalsIgnoreCase("plugintest")) {
Player player = (Player) sender;
player.sendMessage(ChatColor.AQUA + "" + ChatColor.BOLD + "This plugin exists!");
return true;
}
return false;
}
}```
i have this and i exported it but whenever i do /plugintest it doesn't work
You have to register the command.
this.getCommand("plugintest").setExecutor(this); In onEnable
And then the plugin.yml stuff:
https://www.spigotmc.org/wiki/create-a-simple-command/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@upper skiff you swapped accounts so you're not a 'verified' seller by paypals terms anymore. Transactions will auto be put on hold for that reason.
I can't really give any info on them being cancelled though as usually they are just delayed for me, I also personally send money to my new paypal using "good and services" and get myself 'verified' before actually using it for selling(Altho I might have to not do it this time since I didn't give myself enough time)
And I think "Order Processed" is better than shipped since you're not shipping anything(also why that option will auto disable tracking information not required)
did you forget to annotate that method with @EventHandler?
@upper skiff you swapped accounts so you're not a 'verified' seller by paypals terms anymore. Transactions will auto be put on hold for that reason.
I can't really give any info on them being cancelled though as usually they are just delayed for me, I also personally send money to my new paypal using "good and services" and get myself 'verified' before actually using it for selling(Altho I might have to not do it this time since I didn't give myself enough time)
And I think "Order Processed" is better than shipped since you're not shipping anything(also why that option will auto disable tracking information not required)
@frigid ember Order processed seems to imply the product wasn’t given yet
@grim halo
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public void onEnable() {
this.getServer().getPluginManager().registerEvents(new NetherStar(), this);
this.getCommand("plugintest").setExecutor(this);
}
public void onDisable() {
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (label.equalsIgnoreCase("plugintest")) {
Player player = (Player) sender;
player.sendMessage(ChatColor.AQUA + "" + ChatColor.BOLD + "This plugin exists!");
return true;
}
return false;
}
}``` this still doesn't work
do i need the @Override
or @eventHandler
for(int i=0; i>= e.getBoundingBox().getHeight();i++){
loc2.setY(loc2.getY()+1);
if(e.getLocation().distanceSquared(loc)<=r){
ent.add(e);
i=(int) e.getBoundingBox().getHeight();
} does this work?
loc2.setY(loc2.getY()+1);
if(e.getLocation().distanceSquared(loc)<=r){
ent.add(e);
i=(int) e.getBoundingBox().getHeight();
}```
If you sold a product, select Shipped in the order status dropdown. Type in the tracking information and select the shipping carrier.
If you sold an intangible item or service, select Order Processed ('Tracking information not required' will be checked).
I think in the terms of virtual goods order processed fits it more properly.
?
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
@hollow thorn i have reason to believe that this crashes the server
please halp
@h ere
@her e
@he re
why is the loop checking for >=
thats the thing to see if the location is so and so far away from r
which is an input variable for radius
import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin { public void onEnable() { this.getServer().getPluginManager().registerEvents(new NetherStar(), this); this.getCommand("plugintest").setExecutor(this); } public void onDisable() { } @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (label.equalsIgnoreCase("plugintest")) { Player player = (Player) sender; player.sendMessage(ChatColor.AQUA + "" + ChatColor.BOLD + "This plugin exists!"); return true; } return false; } }``` this still doesn't work
@frigid ember @frigid ember
do you know why?
🤔 why am I being tagged for this
idk i need help
kek
does it output errors
no
if you do /plugins does your plugin show in red or green
meaning that it failed to load
this.getServer().getPluginManager().registerEvents(new NetherStar(), this); what is nether star
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
public class NetherStar implements Listener{
ItemStack netherStar = ItemFactory.createItem("Skyblock Menu", ChatColor.RESET, Material.NETHER_STAR, null);
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getSlotType() == SlotType.QUICKBAR) {
if (event.getSlot() == 0) {
event.setCancelled(true);
}
}
}
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
player.getInventory().setItem(0, netherStar);
}
}```
extend javaplugin
extend javaplugin
@torn robin wdym, instead of implements listener?
??
all green
@frigid ember does your plugin show any errors on server launch (failed to launch [PLUGIN NAME] plugin
no
this.getCommand("plugintest").setExecutor(this); this shouldnt be needed
but even if it you didnt have it i dont think that would have an effect
have you tried doing /reload and then doing the command
@frigid ember
public class NetherStar extends JavaPlugin implements Listener
@tranquil plaza i did this and still doesn't work
yeah euan
what api do you use
me?
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }``` @hollow thorn WHY THIS NO WORK
Is someone able to help me include a local maven repo in a gradle project?
Just a jar file as a repo
A plugin I'm trying to compile requires WorldGuardExtraFlags
when you ping yourself
dont make me do it
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
@hollow thorn halp
Dude, Euan, relax.
If nobody answered you they probably aren't going to.
Sending the same message 100 times is just annoying.
You're missing @EventHandler in the last method
JoinListener.java
package de.jann.challenges.listeners;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
public class JoinListener implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
e.setJoinMessage("§6The challenger " + e.getPlayer().getDisplayName().toString() + " has joined :D.");
//
ItemStack challenge_item = new ItemStack(Material.REDSTONE);
ItemMeta challengeitemMeta = challenge_item.getItemMeta();
challengeitemMeta.setDisplayName("§6Challenge-Item");
challenge_item.setItemMeta(challengeitemMeta);
//
boolean exists = false;
for(ItemStack item : e.getPlayer().getInventory().getContents()) {
if(item.getItemMeta().getDisplayName().toString() == "§6Challenge-Item") {
exists = true;
}
}
if(exists == false) {
e.getPlayer().getInventory().addItem(challenge_item);
}
}
}
Console:
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
@hollow thorn
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
?
Caused by: java.lang.NullPointerException at de.jann.challenges.listeners.JoinListener.onJoin(JoinListener.java:23) ~[?:?]
does it detect the plugin and try to launch it on startup
I have this error: Caused by: java.lang.NullPointerException at de.jann.challenges.listeners.JoinListener.onJoin(JoinListener.java:23) ~[?:?]
@rain monolith Which line is #23?
line 23 has a null
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
halp
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
halp
loc2.setY(loc2.getY()+1); if(e.getLocation().distanceSquared(loc)<=r){ ent.add(e); i=(int) e.getBoundingBox().getHeight(); }```
halp
@glad summit if(item.getItemMeta().getDisplayName().toString() == "§6Challenge-Item") {
I don't no what I have to write 😄
?
How euan?
item.getItemMeta()!=null
Use, item.hasItemMeta()
Instead
thank you euan
@tranquil plaza you forgot to add OnEnable and register this as a listener
weird question: how do I crash the server?
weird question: how do I crash the server?
@sharp cradle time out the cmd
you could us something such as
while true{}
You sure there's nothing in console?
add a console print in OnEnable - see if that ever happens.
?paste
@glad summit if(item.getItemMeta().getDisplayName().toString() == "§6Challenge-Item") {
@rain monolith do not compare strings with '=='. Java basics
Euan stop spamming.
I was about to help... but i guess you have to google now.
^^
Is someone able to help me include a local maven repo in a gradle project?
Just a jar file as a repo
A plugin I'm trying to compile requires WorldGuardExtraFlags
also rather hilarious
that it ltierally says the problem
not sure whats so hard in reading a error
@burnt bay Sorry man, I am clueless with Gradle and Maven...
Tried googling it? Sounds like a relatively common question
google the error
I did but I just couldn't figure it out. Thanks anyway
thats not how mafia works
also it literally says what the problem is,spam more and the mods might warn you @hollow thorn
so do bot warns mean nothing then
get enough and ur banned from the discord
oh great so ill need 2 accounts
But you can only connect one with your spigot acc
Euan stop. If you want anyone to help you, be a bit more mature and patient.
also its ironic that all you need is a pair of eyes to even see what the error is
there is a difference inbetween patience and waiting so long tha lockdown ends for something to happen
Caused by: java.lang.NoClassDefFoundError: com/javaminecraft/StaffWeaponUse$2 at com.javaminecraft.StaffWeaponUse.onStaffWeaponUse(StaffWeaponUse.java:221) ~[?:?]
that code was unchanged since the last edit
and ive checked it to no availe
its a red herring by the looks of it
@Override
public void run(){```
With all due respect, man, it has been barely 20 minutes since your first message.
We're not your slaves, and we don't owe you any of our time.
If you can't figure it out yourself - post a question on the forms and wait.
@Override
public void run(){
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
loc = loc.add(loc.getDirection());
int f =100/30;
int i = 100/30;
i = ((Damageable) em).getDamage() - f;
((Damageable) em).setDamage(i);
while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.playEffect(loc, Effect.SMOKE, 500);
world.spawnParticle(Particle.CRIT, loc, 0);
world.playSound(loc, Sound.ENTITY_IRON_GOLEM_HURT, 1, 1);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
if(!(ent.equals(me)))
((LivingEntity) ent).damage(10, me);
}
}
}}}.run();```
also my first message was asking for help on another problem
and was literally ignored
Well, you don't always get what you want. Grow up and use google/the forms.
I don't understand people that use BukkitRunnable
when you can use anonymous classes with lambda
what elese should i use
i dont know what lambda is
that's all my classes
Lol yeah, Viper, it is deprecated - no?
how do i get an equation from a message
@hollow thorn this was one of the older messages 10:21
I don't know, but it's still looks bad and adds so many unnecessary lines of code
() -> {}, is way shorter
seemed to be a reload problem
sorry
also for some reason my plugin only starts on reload
How to use getBlockState() ?? These method is unknown
Version?
1.16.1
You'll have to be a bit more clear, if you want help...
What is the question? What is the context?
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
what class is endcrystal stored under
Palm, look at what SteelPhoenix replied to your post.
java: cannot find symbol
symbol: variable ARMOR_STAND
location: class org.bukkit.entity.EntityType
why am I getting this error?
Im trying to compile a premade plugin
@tranquil aurora Can you show the code that brings up this error?
Also, give additional info - version, intention, etc.
1.8.8
@tranquil aurora Can you show the code that brings up this error?
Also, give additional info - version, intention, etc.
@glad summit do you want me to link the github?
im getting all these errors
That works, yes, if it recent code
Just to make sure, did you add the Spigot jar to your project?
Version?
Hey. Can bungee be with 2 different versions spigot servers ?
?
For example 1.15.2 and 1.12.2
why isnt The EndCrystal under LivingEntity
and how do i damage it
Hey. Can bungee be with 2 different versions spigot servers ?
@bleak plaza i guess you could combine it with waterfall or some other cross version thingy
Working fine for me
how to make that every 5 minutes something happense
Use the bukkit scheduler.
ok
scheduleSyncRepeatingTask
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
i di not
does anyone know what this means?
Caused by: java.lang.UnsupportedClassVersionError: me/palm/menu/Main has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 52.0
update your java
ah ok
8
yep
you've compiled your plugin using 14 but are running it on a java 8 server
java is forwards compatible, not backwards compatible
Hey guys I'm still unable to get this gradle project running, is there anyway I could get someone to try to reproduce what I'm having issues with?
32 bit
o
is there a way I can download JDK 1.8 without having to make an origin account?
I'm trying to find a link but the only place I can seem to find is on origin's sight
Would have to use another project. AdoptOpenJDK is typically the go-to one
No no just another JDK
i.e. instead of installing Oracle's implementation, install a different one
oh
Again, AOJDK is the preferred alternative for most - myself included
so this 🙂
Yes 🙂
sick
I can't remember how I got my JDK, (this is for a friend)
but I don't think I went through ehre
Click it and it will install it.
Microsoft Installer
What? You just double click the file in your downloads folder. Don't open it with your IDE or anything.
bruh
hey guys im having problems with detecting the material a player is standing on
i downloaded it and it went into programfiles
so what do i do
What IDE are you using?
Eclipse
Seems, like you a very beginner of installing programs/applications
Ok IDK then.
bruh
like
code: https://hastebin.com/arafahogox.cs
why you not using PlayerMoveEvent instead of runnable?
Made a bit of a mess up. Left bungee = false in spigot and now I need to set it to true but our 400+ players are going to loose all there data. Anyone know a way around this issue? Tried using this but to no avail https://www.spigotmc.org/resources/uuid-playername-save-file-converter.558/ :/
so
what do i do now
i clicked add external jars
but what jar do i select
after
i setup this: https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot
add library instead
oh
@rare prairie it didnt work
wat
but when it stood on the block it wouldnt say "you found your block!"
rhen what do i choose
library
yep
now i have
execution environment
alternate jre
and workspace default
which one?
it WOrk
@rare prairie https://hastebin.com/ here the event i tried
They're on Eclipse.
but when it stood on the block it wouldnt say "you found your block!"
BSIsOncan be false if you're doing something wrong,p1locblock where you stand can be air, you have to make a new location, likenew Location(getX, getY - 1, getZ)to make sure where the player standing that is a block
Is it possible to disallow the server to generate new chunks?
May be listens to chunk generation events?
We can't actually cancel them
great
Can I disable entity drops on entitydeathevent
Sure. Clear them
how
The event has a getDrops() method
and then
clear
with which command, can you send the two commands please 🍪 ?
No. Listen for an EntityDeathEvent, call getDrops() and clear the list
Given that you should be capable of doing this yourself
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.
?ask
Ask a question and someone will, sure
I would like to code an unknowncommandmessage
There are many yt tutorials, but I don't understand
Could you show us what you have so far?
Wdym?
it would better to learn java first, if you don't understand yt videos @shell zephyr
There isn't much room for "but" here. You should have a basic understanding of the language in which you're writing
I only copy the code text from the youtubers
it's urgent
there are many plugin on spigot which doing this
But not so like I want to have
Do you just want to change the default message for unknown commands?
i.e. "Unknown command. Type "/help" for help."?
There is a configuration option for that provided by Spigot
There should be the command, which the player executed
Sorry Choco, I thought (is this the past of think, I'm not good at english) this is very difficult... 😢
spigot.yml, messages.unknown-command
I know
But I want to have it that i the message is the command, which the player executed, which is unknown
Yeah similar
It should be...
&8[&bThe Dimensi❖n&8] &cDir ist es nicht erlaubt &8[&7UNKNOWNCOMMANDl&8] &czu verwenden!
Or
&8[&bThe Dimensixn&8] &cDir ist es nicht erlaubt &8[&7UNKNOWNCOMMANDl&8] &czu verwenden!
Is it possible?
DerDonut,
Event API: https://www.spigotmc.org/wiki/bbcode.1415/archive
Relevant help thread: https://bukkit.org/threads/how-do-you-change-what-items-a-entity-drops-on-death.66805/
ender crystals don't take damage. they just explode
how do i damage an ender crystal
ender crystals don't take damage. they just explode
@subtle blade then how do i cause that to happen
Shoot at them
in the api
With code
Ehm. I'm not sure there's actual API for that unless remove() does it
@mellow wave But which code?
Not sure either maybe call the damage method
Ah sorry
And see if something happens
Yeah just noticed
Yep, I see no API for this
PR time
for EnderCrystal?
if you listens to EntityDamageByEntityEvent its been called before the endercrystal explodes
Solution is to call upon NMS unfortunately until a PR is made
You could probably just spawn an explosion and remove it. As a work around
EntityEnderCrystal#damageEntity(DamageSource.GENERIC, 1.0F)
So if you want to resort to NMS, you can. Else, Olivio's solution is also viable
Really, that's all NMS does. Just creates an explosion
Explosion radius is 6.0 by default
// CraftBukkit start
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false);
this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
this.dead = false;
return false;
}
this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), event.getRadius(), event.getFire(), Explosion.Effect.DESTROY);
// CraftBukkit end```
question: i have locked something in the 9th slot, you can't drop it but whenever you go into your inventory and click the hotkey on a random slot it goes there
EntityEnderCrystal#damageEntity(DamageSource.GENERIC, 1.0F)
@subtle blade or just summon a snowball inside it
depends on whether or not you want to trigger an event
and how much you want to fuck with the listeners of said events
Is someone able to make me understand a thing? So is like the chat format , the player money, the player prefix all handled by vault?
Like it's managed by Vault
But all the data is saved by plugins
it's like a wrapper
that people can just go and know it will work
for any other million of plugins there are
It kinda sucks that I'm basically forced to use it though...
imagine devs having to support 50 standards for their shop plugin
how can i change a result of a crafting recipe?
Does LuckPerms work without vault? I might just not use it otherwise
I am coding every single plugin by myself so I don't want to use Vault if I can make my own stuff
Cool
@rare prairie i did what u said with new location it didnt work xd
hey guys 🙂
question: i have locked something in the 9th slot, you can't drop it but whenever you go into your inventory and click the hotkey on a random slot it goes there
he's has an inventoryClickEvent which will cancel the event if event.getCurrentItem() is equal to the item he's locked in the 9th slot
the problem is because he technically never picks up the item when he uses the hotkeys to move it, the check doesn't work
how can i change a result of a crafting recipe?
Is someone able to make me understand a thing? So is like the chat format , the player money, the player prefix all handled by vault?
Like it's managed by Vault
Vault is a common interface between these plugins. It just provides methods that can be called upon regardless of its implementation on the server so you can make use of economy without having to depend on 15 different economy plugins
Any decently programmed economy (or whatever) plugin should work without Vault. It should be a soft dependency
It's like Bukkit. Theoretically, it's written in a way that it can be used on servers other than CraftBukkit. Like Glowstone
Yeah I will be using Glowstone in the future
You obviously can't use NMS or CraftBukkit code. It has to be strictly Bukkit API
I know rip NMS
question: i have locked something in the 9th slot, you can't drop it but whenever you go into your inventory and click the hotkey on a random slot it goes there
@frigid ember anyone?
"he's has an inventoryClickEvent which will cancel the event if event.getCurrentItem() is equal to the item he's locked in the 9th slot
the problem is because he technically never picks up the item when he uses the hotkeys to move it, the check doesn't work"
whats the best way of detecting what block the player is standing on
BlockFace
because i tried new location (getx, gety - 1, getz) and it didnt exactly work
huh
Check if he's on ground before
onGround is deprecated
no lol
Does appear to still work though
player.isOnGround() isn't deprecated I think
It is.
bruh xd
* @deprecated This value is controlled only by the client and is therefore
* unreliable and vulnerable to spoofing and/or desync depending on the
* context/time which it is accessed```
so i add isonground as a condition a swell
I mean unless the player is cheating that method works
Ah okay XD
Also I suggest trying using BlockFace
question: i have locked something in the 9th slot, you can't drop it but whenever you go into your inventory and click the hotkey on a random slot it goes there
@frigid ember ..
InventoryClick event
yeah
but i did
look
public void onInventoryClick(InventoryClickEvent event) {
if (event.getCurrentItem().isSimilar(netherStar)){
event.setCancelled(true);
}
}```
i did this
it doesn't work
InventoryMoveItemEvent
Is it in creative?
Listen for the other events too
dragevent
other shit
there is tons of inventory events
IS THERe a hot key one
because i can just hotkey the item into inventory
what does that count as
It's a combination
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryEvent.html Those are the inventory events
hm
getHandlerList()
HandlerList getHandlers()
Inventory getInventory()
Gets the primary Inventory involved in this transaction
InventoryView getView()
Gets the view object itself
List<HumanEntity> getViewers()
which one couild it be
......
?
@frigid ember we aren’t going to spoon feed you the code and answers. You have to be willing to put in your own effort and research into figuring out the answers.
Otherwise you learn nothing
bruh all i am asking is where it is, i can't see it
OH I FOUND IT
i couldn't see it
i was just trying to know where it is on the page
Read the entire page it’s helpful and will pretty much answer any question you have.
If a method isn't working how you'd like it to work, make sure to check the javadocs and see if it works how you think it does.
can I place nms block?
What were the packets for customizing block break speed
so are there any inefficiencies with this code then: https://hastebin.com/uzilahogat.cs
What version atin?
Is it like 1.15.2 or newer?
Don’t use BukkitRunnable
Oh damn okay
There’s also some repetitive code which could have a clean up
Use the BukkitScheduler and use Consumer<BukkitTask> cuz lambdas
oh damn wow okay
thanks
@naive goblet how would i use that xddd
is it the same as runnable like BukkitScheduler() {
}.Consumer<BukkitTask> or something
BukkitTask bukkitTask = Bukkit.getScheduler().runTask(plugin, task -> {
//
});```
You can also
Consumer<BukkitTask> consumer = task -> {
};
Bukkit.getScheduler().runTask(plugin, consumer);```
Ohh okay
when you do runTask(plugin, task -> do you have to put ending bracket
ooh okay
You should learn more about functional interfaces, method references and lambdas
Very interesting
Wym closing?
in (plugin, task ->
so u write down the entire "task" then )?
Uh no
Bukkit.getScheduler().runTaskLater(plugin, task /*reference to BukkitTask */ -> {
System.out.println(“hi” + task);
}, 20L);
//same as
Bukkit.getScheduler().runTaskLater(plugin, new Consumer<BukkitTask>() {
@Override
public void accept(BukkitTask task) {
System.out.println(“hi” + task);
}
}, 20L);```
Might have written something wrong, on mobile
I see
Pretty sure BukkitTask would print a garbage value anyways
this is gonna take a while to understand
Oh well, essentially you’ll have to learn this cuz a lot of more advanced apis and rest APIs use this for callbacks as an example. And not using lambdas would give you huge boilerplate code.
shit ive never used lambdas in java before
What is the best scheduler for running minigames? I use runTaskTimer for the in-game timer and lobby countdown
That would be the one to use in most cases
sweet just wanted to see if I could've used something better
Maybe try TaskChain
never heard of it I'll take a loook at it
?paste
Does anyone know any plugins that if you right-click with an item it runs a command?
I use executable items but the permissions don't work.
If you know how to code just listen for PlayerInteractEvent and when they click the item you want use #performCommand(command);
server owner, not a plugin developer
?
You are a server owner, not a plugin developer. I'm clarifying to palm lol
im not server owner i am admin
but that doesnt matter
idk how to make plugin
@frigid ember do a little research on the forums for one, if you can't find one it's really not that hard of a plugin to code and I'm sure you could find a developer to make it for little to nothing.
so apparently bungee has an exploit that allows anyone to get OP? Can I read on that somewhere? I need to protect my own stuff but another server I watch has been hacked 3 times in a week and they said it's due to a bungee issue
Skript😩
?
@sleek ivy iirc there’s some forks patching it
any ideas which?
@subtle blade i am not a server owner i am trying to learn plugin development
any idea what I can look for? I don't know what the issue is to look based on
it's a catch-22, no one talks about it but as an owner I can't protect myself against it until I find out what the issue is lol
@frigid ember im rlly bored i can make you a simple plugin if that's what you're looking 4
I know, palm. bicxter, the person who you are assisting, is not a plugin developer. They cannot write a plugin. They are just an administrator looking to use an existing plugin
@sleek ivy I highly doubt anyone is going to share where that information is whether you're a server owner or not. It's an exploit which you could use or someone else with bad intent could use to take advantage of a server. It's like exploits in the real world they aren't really shared until they're patched.
I get it, I just hate it. I'm dropping bungee entirely
no sense using a clearly broken product
they got dismantled 3 times in a row
Idk
I would argue differently. As a computing security major I can assure you everything has exploits. Nothing is 100% secure.
But there’s a fork called aegis
@frigid ember im rlly bored i can make you a simple plugin if that's what you're looking 4
@pseudo crown i have to think about it.
Idk but it’s known for being good and patching lots of stuff
ill leave it open source so you can re-build it yourself
?paste
Show code.
?paste
yo how would you get the number of unique player joins?
its an ugly code
hey guys 🙂
hmm, I don't think so.
The indentations as well
I have this code here inside of an inventoryClickEvent
I'm trying to stop a player using hotkeys to move an item fixed in slot 9
*in the 9th hotbar slot
You might have to add onlinePlayers.size too
I usually have an ID associated with my players in my database that's auto increment so I just get the last ID.
unfortunately this doesn't work, as event.getSlot() returns the slot which the mouse was hovering over when the hotkey was pressed
so the code I pasted above doesn't work
the only other option I could find was to completely disable the ability to use hotkeys
but I'd rather not do that
I've look at all the inventory events and I can't see one which would allow me to specifically stop the item being moved
does anyone know of a better way of locking an item in a slot?
or a way to detect which of the 9 hotkeys is pressed?
If so that would be really helpful 🙂
how can i use nms in my codemc build?
in which case that is not supported
run BuildTools, the server will be installed to your local Maven repository
cough Ivan recommended it to me cough but BT was easier
You'll need a local repo if you want to make it far.
does anyone know if there's a way for the aliases added through commands.yml to have the original command's tab complete?
it's basically useless right now except for one word commands like spawn or somethin g since you can't use them really without the tab complete :/
okay, I will try. Thanks.
You should ready why it is deprecated:
Deprecated.
This changes the ItemStack in their hand before any calculations are applied to the Inventory, which has a tendency to create inconsistencies between the Player and the server, and to make unexpected changes in the behavior of the clicked Inventory.
good point
how do i use litebans website thing i have a dmonain already
You need to setup so that the domain points to the host and port which the litebans website is located
What triggers the falling block harm type? Just anvils?
I have a different check for that
Im not sure if the abstract instance works like this? If not you should use .equals() instead.
Also getBlock is a pretty hefty method. You should probably use some arithmetic checks instead
?
Location#getBlock() is not that cheap to call. There are a ton of safety checks before you actually get the block.
You should rather compare X Y and Z
?
@Override
public Block getBlockAt(int x, int y, int z) {
return CraftBlock.at(world, new BlockPosition(x, y, z));
}```
There are null checks for the world for example.
there actually aren't
and even then, that's not expensive
it's a referential comparison to a null pointer
Wait... but Location can have null worlds
it can, you're right
Call getBlock() on it and you'll get an internal NPE
You are right though. No reason to call getBlock() if you don't need that block
I just thought that something like this would be the cheapest:
if (to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ()) {
return;
}
@livid spruce, what theme is that?
you shoudl try looking under datapacks
how do i make a gui in 1.8, if someone can put a tutorial ould be appreciated
I just thought that something like this would be the cheapest:
if (to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ()) { return; }
@grim halo Okay thank you!
So what else can I do to make this more performantly
how can i use action bar
NMS
or just the chat component api
hm can it send an actionbar
yes
didn't know that
event.getPlayer().getLocation().getBlock().getLocation() should be redundant.
@livid spruce Also it depends on the CookieRegion implementation.
Dont know what that is
can i use actionbarapi? is it still viable?
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, "Test")
@grim halo It's not redundant since it will round the location. But it's not the best way
that doesnt work for me
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, "Test")
@quick arch
i dont have the .spigot() function
yeah, that doesn't work there
are you using the Piece of Wood
I hope you're using spigot as a dependency and not something else...
If the plugin uses vectors then in this particular case its redundant.
no
🤔
yeah that's why
Switch jar
aight
I think the wood has a sendActionBar method
yeah it does
so does spigot?
@livid spruce What is CookieRegion? Is this one of your own classes?
it is
probably returning or breaking at some point where a condition is always true
hmm#
generally if you want help, the whole snippet is useful lol
Or .size() is always 0
return at the bottom
but that's not always true?
exactly
unused else 🤔
it will be used
let's see the for loop
would be nice if you would screenshot the code in question lul
Show us the entire loop
nice
*return statement
now the return at the bottom XD
ye lol
Now its redundant
I'm starting to feel like shrek with the number of layers this GUI has x_X
@livid spruce This region implementation is not suitable for the PlayerMoveEvent.
It scales very poorly.
@formal nimbus whats this theme?
@livid spruce This region implementation is not suitable for the PlayerMoveEvent.
It scales very poorly.
@grim halo ???
your theme
What's the Problem
in the picture
my theme?
yes
no, your color scheme theme
IntelliJ theme
yyour ide theme
oh
holy shit yeah that is definitely not how you want to make a region
frick
kekw
how do I check?
can anyone suggest me a very dark theme
I have like an ultra dark theme
that just makes it pitch black
🙉
Have a 10x10x10 region and you now have 1,000 location objects
20x20x20 you have 8,000
Ok ive read this whole class an this will def take a dump on your TPS with as little as 10 Players and 15 Regions.
should be ez tbh
And your memory will be gone. Like instantly if you make a decent sized region.
Yep
There is absolutely no justifiable reason to hold a List of Blocks in a region. Period
SlimeWorldManager
Especially if they're dynamic in size
Yes, that's why I ask for help here.
Probably to check if you're inside it
oof
Very slowly
I don't see another reason
minX > playerX, minY > playerY, minZ > playerZ, duplicate that with < maxX Y and Z
So please tell me what can I do to make it better
You can do that entirely with coordinates
Please tell us what you're doing with all those blocks
Probably to check if you're inside it
Ok i got some experience with protections. My approach is chunk grouped BoundingBoxes. If you want i can give you some tips.
Even just BoundingBox and iterating over every single one (not even grouped in chunks) should yield a decent performance.
minX > playerX, minY > playerY, minZ > playerZ, duplicate that with < maxX Y and Z
That's literally all you need
Though with that being said, Bukkit has a BoundingBox API
All the blocks belong to me
min de max
Same principle only min is the minimum point, max is the maximum point
it has to be min and max for that
?
goddddd
I really need some help with GUIs X_X
I'm dying
I have a GUI with lots of layers
Show us what you've got and what you're trying to do
It's a crate plugin
Why not just fork an existing one
hpwever
Why not just fork an existing one
@mellow wave because i want to make one myself
Where is it possibile to ask for paid requests for custom plugins?
Alright, but you can learn by looking and working with others code
I have a working system
but the code feels a mess
Alright, but you can learn by looking and working with others code
@mellow wave that's true
What would be the fastest/simplest code route to grab an armorstand with a custom name in an area so I can change its Y
and I'm wondering what's the best way of making a multilayers GUI
@tiny dagger what is min max and growth ?
@livid spruce First and second point
how I can minimise memory usage
growth is how much bigger than the selection is considered inside
okay
you can remove that
Okey
i just had uses for it
I feel like my entire GUI code needs a rework )):
@formal nimbus I usually use my own fork of Inventory Framework when working with GUIs. It makes things cleaner and easier
right
but.....
I just realised
what if I made a new class for each GUI layer
and each Layer is a child of the previous layer
Yeah that's how you would handle it yes
Looks good
Yeah that happens, don't give up :)
are package declaration all lower case
you're missing the + 1
or are they lowerCamel?
Package are lower case
k
com.domain.packages.should.look.like.this.evenwithmultiplewords
yes.this.is.my.cool.package
What would you say is the best way to store an ItemStack in some sql db? because obviously i dont want to create a column for each attribute of an itemstack
you.dont.wanna.confuse.with.Class
hey is there any virüs in block shuffle game ?? i wanna play it but i cant trust
@native shore Serialize it as String if you dont need attribute access for sorting etc.
okey thx 👍
hey is there any virüs in block shuffle game ?? i wanna play it but i cant trust
@tiny falcon ??
@tiny falcon Plugins on spigotmc are usually safe. But avoid newly posted plugins and read the reviews
This tool can somewhat help, https://www.spigotmc.org/resources/spigot-anti-malware-detects-over-200-malicious-plugins.64982/
hmm i read but there is just 4 rewiew
@tiny falcon Whats the plugin? If its not huge i can take a look at it. Also the Spigot Anti-Malware is pretty nice.
block shuffle game
Send a link
source code on google drive 🤔
So it has no op backdoor
however, can only play with 2 players 🤔
If i had this on my server i would consider it a virus. (Because the code is just horrendous)
loll
ok
Ohhhh RIP naming conventions.
i wont download it 😦
Its fine
use it
It probably does its job
And you dont get a plugin because you want to look at the code right?
so i can download ??
Sure.
ok ty
Some people do want to look at the code
🤔
yes
;-;
usually you dont use underscores in package names and i'm not sure about the names
usually you dont use underscores in package names and i'm not sure about the names
@native shore but then it becomes difficult to distinguish between words?
oh boi
tutorial time I guess ):
I cant load anything from net.minecreft
import net.minecreft.*
cannot resolve symbol 'minecraft'
i dont understand why you're using the word "children" in each package
Do you have the proper dependencies
I am Having an issue where every player that joins the server is recieving a new UUID and losing their progress in all plugin features, this happened seemingly overnight with nothing we did to trigger it. Any Ideas?
i dont understand why you're using the word "children" in each package
@native shore because everything in that package is a child of the class specified in the title ;-;
anyway I'm looking up a tutorial
hm but you dont have to put in each package :D usually you put each class of some type in the same package
for example...oof
something like blocks
you have a package like org.bukkit.blocks and you put everything about blocks in this package
if you need some abstraction you could do something like org.bukkit.blocks.physics and in this package you put everything about the physics of blocks
if you really want to use more than one word in a package name wourld do like this -> de.marcel.packageName instead of de.marcel.package_name
oh
@faint lance are you importing the right dependency in Maven (assuming you're using it)?
so you do use lower Camel
This is my current approach
public static String serializeItemStack(final ItemStack itemStack) {
final NBTTagCompound tag = new NBTTagCompound();
CraftItemStack.asNMSCopy(itemStack).save(tag);
return tag.toString();
}
public static ItemStack deserializeItemStack(final String string) {
if (string == null || string.equals("empty")) {
return null;
}
try {
final NBTTagCompound comp = MojangsonParser.parse(string);
final net.minecraft.server.v1_16_R1.ItemStack cis = net.minecraft.server.v1_16_R1.ItemStack.a(comp);
return CraftItemStack.asBukkitCopy(cis);
} catch (final CommandSyntaxException ex) {
ex.printStackTrace();
}
return null;
}
I was told just lower case D-:<
@balmy sentinel yes
I can't find a tutorial for a layered GUI anywhere ;-;
🤔
nimble0 when I turn the server to online mode bungee cord no longer works
Yes this works.
as in a GUI with multiple pages
@formal nimbus Then look at Inventory Frameworks source
<< and >> right buttons
or some other api
@faint lance can you show me what you're Maven dependency looks like
@formal nimbus Then look at Inventory Frameworks source
@mellow wave right... I'll see if I can find it