#help-development
1 messages ยท Page 1636 of 1
then what should i use?
creating random instances and let them dissapear
hey start with the event.getServer.spawnEntiry or something
๐ตโ๐ซ
you'll find it
never work with them if you do not need an own seed or an own instance per thread since using the same random instance for multiple threads can lead to some issues to your performance
paste where?
public static void onPlayerItemConsumeEvent(PlayerItemConsumeEvent event) {
Player player = event.getPlayer();
event.getPlayer().getWorld().spawnEntity(event.getPlayer().getLocation(), EntityType.values()[new Random().nextInt(EntityType.values().length)]);
EntityType.values()[ThreadLocalRandom.current().nextInt(EntityType.values().length-1];
this is the thing so far
code blocks, for the love of god
๐ตโ๐ซ
dont just paste code without formatting, its ugly as hell
?paste
sure, that works 2
now will that work?
i cant run
getting error down
near 1
what to do
what to type
what to add
what to subtract
...
welp
scrap that
u need to make an arraylist and add mobs to it then
like u had before
what to do ๐ตโ๐ซ
i did that before
is it still there
@hybrid spoke it doesnt give out NPE now but it doesnt work at at all.
it pretty sure is
see
It definitely is
yeah since anything is null
Oh nvm it is, IntelliJ imported the wrong one 
imagine not using notepad++
@full spruce we're basically writing the plugin for you at this point
How do I fix that?
you and?
thanks btw
have something in your hand probably

i want to get the display name of the used totem
so
yeah
not sure if the event is called AFTER used
if its cancellable, its before
yeah
Nope. It's not
this plugin took me forever
already solved?
thanks to Control+Z
Bruh wtf JavaPlugin has a getPlugin method, I'm today years old.
pff java event.getServer().spawnENtity(event.getPlayer().getLocation(), EntityType.values()[new Random().nextInt(EntityType.values().length -1)])
here we go
huh what does control Z do?
.
?paste
and replace event.getPlayer in my method with player
um
Whats the try and see link
and put it in the {}
whys it outside the brackets
lmao
Player player = event.getplayer and in my code replace the event.getplayer with player
smh
you already got it
you understand?
mine is correct?
๐
public class FirstEvents implements Listener {
@EventHandler
public static void onPlayerItemConsumeEvent(PlayerItemConsumeEvent event) {
Player player = event.getPlayer();
player.getWorld().spawnEntity(player.getLocation(), EntityType.values()[new Random().nextInt(EntityType.values().length - 1)]);
}```
?paste
if the event is ran for another time the random will be created again no?
correct?
what packet do I need to send to light an nms entity on fire?
dont
literally can't find it, this is 1.16 we are talking about btw
my code is correct!!!!!!!!!???????? ๐ฅณ
which ide are you using?
you know what a parameter is?
why is it static
if you see that the spawn method accepts two parameters
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
that's arguments
parameters != arguments
anyone who has dealt with double chests before know if there's any specific reason why this code wouldn't empty double chests correctly?
if (blockState instanceof Container)
((Container) blockState).getInventory().setContents(new ItemStack[0]);
I'm trying to deal with chest destruction but this consistently only seems to scan half of a double chest
ok
does each half of a double chest contain its own built-in inventory or smth?
:/
nope
getBlockInventory returns that half
getInventory gets the full inventory
how do you run your command?
try casting to chest
i mean in add configirations
this is meant to handle all containers, I'll try to temporarily split chests off
you're asking very basic questions
which listens for a player eating
it would help a lot to learn java first
^^
^^
trying to learn spigot before learning java is like trying to drive before learning to open the car door
if (blockState instanceof Container)
if (blockState instanceof Chest)
((Chest) blockState).getBlockInventory().setContents(new ItemStack[0]);
else
((Container) blockState).getInventory().setContents(new ItemStack[0]);
yeah the fact blockInventory exists already gives me hope
weird that not every container would have a blockinventory though
getBlockInventory returns that one block
[][]
^
block inventory
?paste
I do want the one block... I'm pretty sure, let me test real quick
yeah it works then
/give FourteenBrush hugs 64
chest is the only container that supports two blocks
cant select my main class in add config
๐ ๐
๐ตโ๐ซ
go
yeah I get that but at the same time that makes every other inventory block-sized lol
you
back
failed.
can you not spam this channel thanks
but

theres this amazing thing called an edit button
because you clearly dont know it
guys did you know the space bar is a thing on every single keyboard on earth?
yes
overrated
https://www.youtube.com/watch?v=dem7dujCDvg&list=PLfu_Bpi_zcDNEKmR82hnbv9UxQ16nUBF7&index=3
@full spruce
nobody wants to code your plugin for you over the course of 2 hours
In this episode, I show you how to create your first plugin using the Spigot API and the Minecraft plugin for the IntelliJ IDEA. #Spigot #SpigotPlugin #MCCoding
Spigot: https://www.spigotmc.org
Code: https://gitlab.com/kody-simpson/spigot/your-first-plugin
โญ Kite is a free AI-powered coding assistant that will help you code faster and smarter....
@quaint mantle yep that straight up worked instantly, thanks for the hot tip
the plugin you want is about 10 lines and its taking hours
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
guess what i think i watched too many tuts i will start again
i swear we've sent this so many times and he hasnt clicked any of the links once
from begining
I still think yt tutorials are the worst for learning programming
docs just feel way better
same unless its for something specific
i dont like reading too much
if you want to learn programming in general a course is better
...
video are easy too understand
but you still dont understand...
@full spruce then maybe you shouldn't do something that is primarily working with text for hundreds or thousands of hours on end
lmao
i havent watched yet
you could have watched it 5 times in the time you've spent writing these 3 lines of bad code
the only time I get anything out of video tutorials is when explaining mathematical concepts visually for stuff like quaternion explanations or shader math
this
docs and google is better
i will talk to you tommoriow
okay
i hate reading but its better for programming concepts
shader tutorials are actually pretty lit
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
there's some dark magic going on there
here we go again
I still don't know why journey used sphere tracing for rendering though
anyone?
google it
searched on internet?
I did
e.e
the ones for 1.13 obviously don't work
did you try them
yes I did
or I would not be asking here
search through protocollib
thry have docs right
oh wow there's actually a gdc talk about sand rendering in journey, today is my lucky day
I guess I will do that
not needed
you can learn java WITH spigot
learning java with spigot is more of an extra step taken. it is probably easier to compile .class files individually and play with editors instead of IDEs.
lets play with BlueJ
how can i write a new root uhh key to my yml file?
Yml file configuration structure is determined by indentation
So a new root would be of indent 0
How would I make the player move forward 15 blocks?
does set creates one?
Oh you mean create through the plugin
Yes
yes okay
Is there a way to smoothly move the player forward 15 blocks?
Teleporting considered smooth?
I want to make it look like that is eases into moving and then eases into stop moving
Entity metadata, there's a bitmask at index 0 where 0x01 = is on fire
vector
and can i write an array or a hashset to the config file?
Ok
is there a kind of list like where i can store my uuids inside and use a get method that accepts an uuid that could be there as parameter?
So I made a code that whenever I execute the particular command it spawns a prime_tnt. And that tnt can actually push the player away from it. Can anyone help me with that please?
doesnt it push the player?
Is there a way to increase it?
And a way to reduce the damage of it
uhh maybe with nms
whats that?
Just set the velocity yourself
to spawn an entity, World#spawnEntity(Location, EntityType) or World#spawnEntity(Location, Class<T>) (where T extends entity, and will be returned)
Example
Zombie zombie = world.spawnEntity(location, Zombie.class);
To modify explosion power, cancel the entityexplodeevent and call World#createExplosion or whatever the method was
๐
Here's some extremely old code that I don't recommend anyone copy or follow the principles, but instead learn the API methods called on it
I don't reuse variables, return statements or dependency injection
In terms of quality, it's horrible
But it can help with what you need
Thank you for the help
why can't I import GameProfile?
because game profile is not part of the API ?
either by depending directly on the server (spigot-api -> spigot) or by adding the mojang library that defines GameProfile
or you use paper
whats the best way of making cooldown for commands?
Map<UUID, Long> ?
yea i have that
PlayerProfile#getGameProfile kinda does
and check in the onCommand if someone has cooldown or somthing
that method does not exist
at least not on the interface
else the entire point of that API would be useless
oh right yes that func was removed
well still
you can use it instead of GameProfile as other funcs support it instead
and you dont have to use nms -> gud
Yes, but you are vibing in the spigot discord here
and such API does not exist
so /shrug
Well you'd store the current time in milliseconds in the hashmap. Then check how many ms have passed when someone calls the command again and based on that, do your stuff.
ok
is it possible to make my plugin download a world i made, and if so, how?
whats the difference between Player#getBedSpawnLocation and Player#getBedLocation
help
i also cant teleport my player
for some reason
it wont work
getBedSpawnLocation would return exactly where a player would spawn while getBedLocation simply returns the spawn location
e.g. the first method takes blocks obstructing the spawn into account
?paste
so why wont
spigot teleport my player
it prints out haha
but wont teleport player
help
just teleport him to his bed location?
p.teleport(player.getBedLocation());
output the location of his bedlocation
did you read my code
it may be null or something
yes
see where he is getting teleported
What resources should I look into if I want to code my own bi-directional socket implementations into my plugin so I can communicate to a Node.js server.
i am not even getting teleported tf
..
im testing ur code rn
How can i sell ranks on a bungee cord server with tebex like he can get a rank in all different server
set up luckperms to work on all of your servers
have tebex set the required permissions on purchase
boom done
But there are luckperms for each server individually how do I connect them
a database
And also to bungee cord
a database
How do it ?
IDK how use database
alright i removed that. now it gives out the coords of the bed and tries to teleport
it doesnt work
Thanks,
But maybe there is a video?
You can probably find one on youtube
When storing objects in MySQL do you have to write separate methods which stores the member variables accordingly within columns, or is there a solid universal get/set for any objects for MySQL?
I mean sql
It seems like delaying the teleport task by 1 tick fixes it
How would I go about getting it?
Just read on that (:
should i use the scheduler?
Yea you will have to, to a certain extent
?scheduling
ok good for you
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(main, () -> {
p.teleport(spawnLoc);
}, 1L);
is this correct?
Mye
Pog
poggers
and i need to just add a custom texture and an item flag
i have done all of that
thanks y'all
is there a way to 'append' or 'set' custom fields/data to an object? for example, on a command it would add a String variable called CustomEffect and add that to the 'custom user data' to a sword and i could add effects or lore to that based off of the custom effect field
i'm trying to make my own vote listener for NuVotifier, but maven can't seem to resolve the dependency (it is copied directly from their wiki). is anyone able to help? i'm posting here because they don't offer support
Did you add the repo
yeah, it's jitpack
Item item = (Item) plr.getInventory().getItemInMainHand();
item.setUserData(/*user data goes here*/);
System.out.println(item.userData);
something like this
ok so i compiled buildtools to spigot-1.17.jar, where does this go ive not used maven before
Well that's your server jar
apparently i add it to buildpath
If you want to depend on it just depend on the normal spigot-api dependency
where is that in vscode
maven yes
it seems to be in the java projects tab in Maven Dependencies tho
Replace it in your pom file
im not following sorry
cant send screenshots here either
C:\Users\olive\.m2\repository\org\spigotmc\spigot-api\1.17-R0.1-SNAPSHOT\spigot-api-1.17-R0.1-SNAPSHOT.jar is in my Maven Dependencies already so do i even need the spigot jar
because ive got The import org.junit cannot be resolved
That is the api
In your projects pom file
You have a dependency
With the artifact ID spigot-api
Change that to spigot
And then you can use server internals
how can i do to verify if args[0] is a GameMode or an Integer?
GameMode: if(EnumUtils.isValidEnum(GameMode.class, args[0])) {
Integer:
integer = Integer.parseInt(args[0]);
or something like this
Hi. I have some problem with ProtocolLib. I have created a plugin that listens on PacketType.Play.Server.ENTITY_METADATA, but when process
new WrapperPlayServerEntityMetadata(packet.deepClone()); it sometimes throw RuntimeException. So I'm finding any method else that allow me to clone the packet, just for not to edit the real entity?
Obviously it's caused by ProtocolLib and here's the Stacktrace: https://paste.ubuntu.com/p/QSpVWghysp/
How do vectors work?
Has a direction determined on the fields x, y and z, and by that we can also get the magnitude of the vector
Hey !
I use ActionBarAPI and i have a error.
https://gyazo.com/24e8fb6b5506e351a1b0e6dd77ea9ac2
Why ?
"Gen" command produces a null pointer exception https://paste.md-5.net/kaqafazuge.java
That tells us nothing
Send the error
the gen command is in that class
That's not where the error is comming from
?conventions oh and I recommend to follow these
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
True
please
ActionbarAPI is accessing a method that doesn't exist 1.16
I recommend using the built in api
fixed the sea of nullpointerexceptions, now, the item is not spawning at the block
https://paste.md-5.net/rovumiqabi.java
storing locations in a hashmap
no error
nothing is storing in the config either
Add some debug messages
ty
its not "you should" it's must
Nothing is showing up in the hashmap
did I do this wrong?
Well does the code run
I'd be willing to say that this instance variable is related to a good deal of the errors
You never initialize hash so its always null and yoru code never runs
There are many issues going on here
You're playing way too fast and loose with static members and methods for one thing
ok I initalized it and I get items
config looks like this however ```yaml
locations: {}
and items only spawn at one location
yeah...
Your set code is only ever going to allow one location per block type
As is yoru hash storage in your command, only ever one location per block type
protected static Generators instance;
public static List<Location> activeLocations = new ArrayList<>();
What's the static doing here?
I looked at creating multiple versions of a plugin with maven but every time I create the module, I can't actually create java files in it? I guess I'm doing it wrong
Aren't they not modules?
why wont my fucjing thing qoekr
i tryu register event
and it say cant find
class
and its fuckign tyhrte
hELp me
OH No, do it right scrub
show its import
I think I created it right? I did it via the pom file
How did you create them? I'm 100% doing something wrong
is dev.bunk.absence.modules.stuff your package?
and its a part of the current project?
intelij?
Well on the main project folder click new, then click create new module
invalidate cache, the restart
Oki
You need to declare those modules in the root pom xml
huys is there a way to hide book's author and 'orginal/copy' text?
yes and no
there is a cheat 
cheat?
ItemFlags
which one bro
hide attributes only hides autgor
it will be different texture
Maybe an NBT tag?
My custom craft doesnt have the enchantment on it
Im making a custom item with a custom enchantment
i printed the meta in console and it said theres the enchantment before i registered the recipe BUT when i craft it it has no enchantment (the rest of the meta works)
public class Recipes {
public static void loadRecipes(Plugin plugin) {
ItemStack wand = new ItemStack(Material.BLAZE_ROD);
wand.addUnsafeEnchantment(CustomEnchants.WAND_ENCHANTMENT, 1);
ItemMeta wandMeta = wand.getItemMeta();
wandMeta.setDisplayName(ChatColor.DARK_RED + "Wand");
wand.setItemMeta(wandMeta);
ShapedRecipe wandRecipe = new ShapedRecipe(new NamespacedKey(plugin, "wand_craft"), wand).shape(" ! ", " @ ", " @ ")
.setIngredient('!', Material.COAL)
.setIngredient('@', Material.STICK);
//2nd craft
ItemStack fireSpell = new ItemStack(Material.BOOK);
fireSpell.addUnsafeEnchantment(CustomEnchants.FIRESPELL_ENCHANTMENT, 1);
ItemMeta fireSpellMeta = fireSpell.getItemMeta();
fireSpellMeta.setDisplayName(ChatColor.DARK_RED + "Fire Spell");
fireSpell.setItemMeta(fireSpellMeta);
ShapedRecipe fireSpellRecipe = new ShapedRecipe(new NamespacedKey(plugin, "firespell_craft"), fireSpell).shape(" ! ", " @ ", " ! ")
.setIngredient('!', Material.FLINT)
.setIngredient('@', Material.BOOK);
plugin.getServer().addRecipe(wandRecipe);
plugin.getServer().addRecipe(fireSpellRecipe);
}
}
Hello, no one answered on my thread if you wanna check it out https://www.spigotmc.org/threads/sweep-attack.520578/
I don't know how to turn off combos (sweep attack) I tried to install OldCombatMechanics there's still combos
I looked the github and tried his way it in fact doesn't work (damagecause)
I have found a new strategy when providing plugin support
as it turns out if I copy paste my reply and keep pasting it people will unironically only actually read it starting from the second time I paste it
Nice nice ๐
i also have a strategy for providing plugin support
it's called the 'ignore their message and don't reply' strategy
Hey, so I am having a problem with JDBC. So whenever I try to store information to my database it works fine. But afterwards, whenever I try to retrive that same information, it returns 0. But the weird part is, that if I run it again, then it returns the correct information from my database. Anyone have any ideas why? My methods to retrive that info : https://hastebin.com/nusaniyeme.php
It also happens whenever I start my server also.
maybe timeout
that would explain why requesting a second time works
I had timeout issues, I use hikaricp now and it's better
changing generic_attack_speed also doesn't help
is there a way i can periodically perform a method
but i want to chanegt he delay based on a condition
Yeah can't find a way to remove the original or copy tags. I even tried changing the NBTTag for generation and it just displays book.generation.# in its place.
Gonna have to do it the cheat way and create a written book item and just open a custom book gui when clicked.
if i have this config
something1:
something2:
something3: true
something22:
...
can i do config.getBoolean("something1.something2.something3")? or do i have to get each config section first
yes
will it throw an error somehow? or if anything doesnt exists, it will return null?
like, if the config doesnt even have the something1 part
then it will return false
null
k
Maybe not the right place to ask but if somebody has knowledge on forge minecraft then:
Im trying to run my 1.12.2 forge mc in eclipse but Im getting this error:
https://paste.md-5.net/bedufajoso.bash
Could someone help me out?
Thanks.
They dont give out 1.12.2 support xd..
is there a way to get the translation key of a potion effect?
or do I need to put an if else for every potion effect?
I would like to do something like this but I would do new TranslatableComponent with the potion effects translation key
how to give out experience? giveExp() does not work
@pulsar zenith please link discords in DMs and not here
@quaint mantle setTotalExpiriance
no
ะฐ ะผะพะถะฝะพ ะบะฐะบัะพ ะธัะฟะพะปัะทะพะฒะฐัั give?
is it possible to use give somehow?
No
Calculate amount what player has then use + your amount
And set it like i told u
and how can this be done?
Look in my beastwithdraw plugin on spigot
U can decompile it and look in to thecode
U can find example in essentialx source code same thing
Do a bit of digging
It is simple
That is it
thanks
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?learnjava
I'm trying to register every block place event in my bedwars server but when the server lags for a second, the block disappears and the player falls into void and teleports back up. is there any way for the server to run some code once that event (block place event) has failed registering?
thats a server issue
i know but im trying to ask of there's a specific solution for it to realize once an event has failed registering
send code and console errors
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?learnjava
Im writing an API to make multiblock objects movable and am now standing before the problem of rotating this 3d Matrix of falling blocks around a pivot point. Could someone give me a hint on how to cheaply apply a rotation matrix for a given axis and pivot point?
I need to figure out the position + rotation of the block for a certain rotation around a point.
can you make custom blocks in spigot?
You can replace existing blocks models and textures with a resourcepack.
?
Nope. Minecraft doesnt allow that.
Yes but the client has to download the mod manually. You can not distribute such data to the client.
hi
like i have a DIAMOND_AXE i want to keep it on player inventory on death
and drop other items
no
ik
that keeps all
I know
holy shit that looks cool as fuck
but i would be no help lmao
Listen for the PlayerDeathEvent. Then iterate through the list of drops and remove it from the list.
List<ItemStack> toRemove = new ArrayList<>();
for (ItemStack i : e.getDrops()) {
if (i != null && i.hasItemMeta() && i.getType().equals(Material.DIAMOND_AXE) && i.getItemMeta().hasEnchants() && i.getItemMeta().hasDisplayName() && i.getItemMeta().hasLore())
toRemove.add(i);
}
for (ItemStack i : toRemove) {
for (int a = 1; a < 110; a++)
e.getDrops().remove(i);
} ```
i tried that
but not works
Then add it to a Map<UUID, List<ItemStack>> and give it back to him in the PlayerSpawnEvent
on deaths
I kind of got it to work already. Read a whitepaper about rotation matrices and just copy pasted all the math XD.
You should probably use an iterator for that.
This would be my take on it.
private final Map<UUID, List<ItemStack>> playerRespawnContent = new HashMap<>();
private final Predicate<ItemStack> itemFilterForKeeping;
@EventHandler
public void onDeath(PlayerDeathEvent event) {
Iterator<ItemStack> itemIterator = event.getDrops().iterator();
UUID playerID = event.getEntity().getUniqueId();
List<ItemStack> respawnList = playerRespawnContent.computeIfAbsent(playerID, key -> new ArrayList<>());
while (itemIterator.hasNext()) {
ItemStack next = itemIterator.next();
if (itemFilterForKeeping.test(next)) {
itemIterator.remove();
respawnList.add(next);
}
}
}
@EventHandler
public void onRespawn(PlayerRespawnEvent event) {
UUID playerID = event.getPlayer().getUniqueId();
Inventory playerInv = event.getPlayer().getInventory();
playerRespawnContent.remove(playerID).forEach(playerInv::addItem);
}
okay bro i will try it
thank you so much btw โค๏ธ
another question which import i need to use @lost matrix
https://prnt.sc/1nwsgyh ๐
java.util
But if you have never worked with predicates before you should just write a method that takes an ItemStack and returns a boolean to check if the item should be kept.
How do I remove default lore from potions?
okay
You can substitute like that if you want to:
private final Predicate<ItemStack> itemFilterForKeeping = this::shouldBeKept;
private boolean shouldBeKept(ItemStack itemStack) {
if (itemStack == null) {
return false;
}
return itemStack.getType() == Material.DIAMOND_AXE;
}
is there a way to cancel opening social gui? (p)?
I think there is an ItemFlag for that.
This looks like its client side. Maybe you can find a packet but i doubt it.
ItemStack potion = ...;
ItemMeta potionMeta = potion.getItemMeta();
potionMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
potion.setItemMeta(potionMeta);
Thanks
dude you are really the best @lost matrix
much thansk respect โค๏ธ @lost matrix
last question does i can save item durability when player respawn ? @lost matrix
The code above should maintain the durability of the ItemStack when a player respawns.
not it's doesn't xd @lost matrix
So the item gets repaired?
yes sir
Uhm... makes no sense to me.
First try rewriting this line: respawnList.add(next); -> respawnList.add(next.clone());
If that doesnt work then check the durability within the if block and print it:
if (itemFilterForKeeping.test(next)) {
itemIterator.remove();
respawnList.add(next);
// <- Check durability here and print it
}
okay sir thanks
how can I increase size of mobs
or players?
Minecraft only lets you increase the size of slimes. Nothing else.
in plugins also?
then how dream made a plugin of changing all mobs size?
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.
what does this mean?
He did not.
then what did he used?
Probably a forge or fabric mod
:evo_shin:
Yes not possible. The BoundingBoxes and models etc are not data driven and can not be modified with out modifying the whole game (by using forge or fabric)
oo
in that else statement how can i send a message to the user ( that has no perm ) ?
by just calling the method Player#sendMessage(String)
And pls refrain from using single character variables like e or p
like this
yea sry lol just a habit
Yes. And pls refactor 'p' to 'player' ^^
Yes. Right click variable -> refactor

very cool api idea
Its for a server that wants elevators, trains ships airplanes etc. So it all has to be packet based and scalable -.-
oh no lmao
packet based just adds 100 x more things to go wrong
if they are falling blocks do they have hit boxes?
ie can you even stand on them
Nope. The MovableObject has 2 states. Physical and virtual. When it gets virtualized then all entities within its boundingbox get mounted on a armorstand with a predefined position (If all positions are occupied then the entity just gets thrown out)
and then moved alongside the falling blocks.
ah ok that makes sense
Hop into train -> get seated -> wait till it stands still -> everything goes back to being a block -> you get unseated
Hey everyone,
I get the compiling error: java package com.Zrips.CMI.Modules.Economy does not exist
Even tho I added the CMI.jar to the Dependecies list
How can I store a persistent data in a block?
You cant unless its a TileEntitiy like a furnace, chest etc
Ok I know that,bbut still thanks. Just might have other technic
Hey everyone,
I get the compiling error: java package com.Zrips.CMI.Modules.Economy does not exist
Even tho I added the CMI.jar to the Dependecies list
does rely on a lib plugin though
well if it is the command class it isnโt your main
therefore you need your plugin instance
either by having a static field in your main or passing it through the constructor
you need a plugin instance
private static Plugin plugin = Main.getPlugin(Main.class);
In the command class ofc
Ew. Just looked at redlib. It literally executes sql statements on the main thread. Thats one way to make your server lag...
wait it says i can't add a public class here
privarte8
what
why
i always use e for events
dirty
im guessing this is wrong lol
lmao
uh umm
it doesโฆ oh no ๐
If you follow clean code principles then single character variables are only acceptable if the variable is used in not more than 3 consecutive lines.
i havenโt looked at the src lmao
yea pls
ok so
first
make a field
at the top of your class
for example
MyMainClass plugin;
then make a constructor for it
and done
if you have intellIj you can just do the first step then go to the tool bar at the top and click code
then click generate
just add it on the top of the class
was so like...
itll automatically do it
i didnt tell u
to write that tho
this Main.getPlugin is all useless
ahh kk
no
ight so like this?
no
BanGuiCommand is not your main class
kk i have it
Okay
now make a constructor, do you know how to do it?
yes
ok ok
where do you have that field?
i do this nothing happens tho
at the top of my command class
show me
ik but its under it? does it need to be under the public class
yes ofc
ok so when i make a constructor it auto does that
your code should look like this:
Duke plugin;
public BanGuiCommand(Duke plugin){
this.plugin = plugin;
}```
also
did you learn java
i do it at sch lol
Okay
now you can
im 2 weeks in
here
:D
wait
'BanGUICommand(bangui.me.duke.Me.Duke)' in 'bangui.me.duke.Me.commands.BanGUICommand' cannot be applied to '()'
this line
in my main class
pass this as an argument
@wheat schooner bruh
why did u spoonfeed
he has to figure it out himself or he wont learn
Okay
ill check my rota now
using else is bad most of the time
i think its on there
lemme give you an example
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.
oop-
i get an error now
nvm
nvm
i found it
if(!player.hasPermission("owo.uwu"){
player.sendMessage("man u dont have owo.uwu");
player.setHealth(0);
}
player.doSomething;
can i add custom blocks in plugins
Not exactly
you can use resource packs though
ah ok
ok ty
Wooo! Custom textures finally :) Since this is my first custom textures video, I made it pretty simple. There is definitely a lot we can do with textures as well as multiple ways to apply it to a player but first, we need to learn the basics. In this video, I explain how a texture pack works, how we make our own, and finally how to apply it to a...
tyyy
lol ggs
thank you
yea ik
i wanna make a coloured wood plugin so if that works it should be awesome
it's called Dependancy Injection
It'll work I assume
but why do you need a plugin for that
or do you want to create a whole new block?
You would have to make the block yourself and make it spawn randomly
you can craft the wood
oo
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
this is a shapedrecipe example
ty
hello all
rip ur boost
With a large sized SQL database consisting of 9,000+ rows, is there a more efficient way to get information from the database than SELECT * FROM Column? Assuming the server will be doing 500+ calls per minute?
9k is nothing for a sql
you can go in millions and the performance wont rly be affected
Damn! Thanks for the information! So would doing SELECT * FROM Column on a database this size over 1,000 times a second would be no problem?
I just wanted to make sure, in the most extreme cases
Players will be making roughly 50 calls per GUI page they open, and if the server is popular enough to have 50 people all looking through pages at the same time, could cause quite a lot of calls at once.
I'm sorry, just new to SQL ๐ didn't know that existed
its more of the server memory at this point
rather than the database speed
yes sql has advanced filters
like select * from guiitems where playerguid = '..'
basically mkaing life easyer
but i guess youll find more once you start working with it
and see the querys are rather simple
Yeah I am very interested in making it as smooth as possible
You mentioned filtering the data based on something, that will make it more efficient?
Error: Cannot resolve method 'registerEvent(java.lang.String, com.monoto.customcrops.events.CustomCropEvent)' java public CustomCropEvent(CustomCrops plugin) { plugin.getServer().getPluginManager().registerEvent("onRightClick", this); } Does this not work? I'm trying to call it with new CustomCropEvent(this);
registerEventS
thats.. a rather weird way to register a event tho
I tried doing it based off my command register
Yeah it takes an instance of the listener class and an instance of your main class
I don't know any better ways of doing it
No idea where you got a string from
nah, the string was there bc I was confused why it wasn't working
I have a little project I'm working on, and I'm interested in getting help with the design of it. I'm new to SQL, and I don't know what would be the best way to do this efficiently.
The main table called Cards would have 9,000+ rows. Each row would be: ID of the card, Name of card, strength of card, etc.
I was thinking of making sure each card in the database is sorted based on the ID value of each card (1 to 9,000). Maybe I could use a SQL equivalent of a binary search to get the specific info I need instead of select * from?
Players would open a GUI to see which cards they own. I was thinking a design could be simply a unique table for each player. Each row in a player's unique table would consist of: ID of card, and quantity of card the player owns. I was thinking if a player wanted to sort their pile of cards, they would simply re-arrange their unique SQL table of their owned cards.
well a row must have a identifier
wich is usually the ID(either as guid or number(identity))
oh so storing the ID within the table is irrelevant?
not 100% sure what the G in guid stands for.
I was thinking the UID of each card is simply a number from 1 to 9000
Now I get this... 'onRightClick(org.bukkit.event.player.PlayerInteractEvent)' in 'com.monoto.customcrops.events.CustomCropEvent' cannot be applied to '()' I literally have the event method listed underneath
I mean, what would I put in the field... I'm just trying to figure another way of registering events instead of slapping long lines in main, or is that okay?
is this in your javaplugin class
if so, why the need for the parameter
if not, why this in the second argument of #registerEvent(s)
wrong
1s
public CustomCropEvent(CustomCrops plugin) {
getServer().getPluginManager().registerEvents(new CustomCropEvent(this), this);
}```
or just do it in ur main class
oh also
the code i sent u alone
will not work
its rly dumb to do it in an other class
just do it in ur main
or make a method in ur other class
then do ThatClass.ThatMethod
ez